XML technologies / XML Schema / Data type reference / xs:base64Binary
(Excerpt from “XML Schema” by Eric van der Vlist)
Binary content encoded in base64
Derived from: xs:anySimpleType
Primitive type: xs:base64Binary
Known subtypes: none
Facets: xs:enumeration, xs:length, xs:maxLength, xs:minLength, xs:pattern, xs:whiteSpace
Definition
<xs:simpleType name="base64Binary" id="base64Binary">
<xs:restriction base="xs:anySimpleType">
<xs:whiteSpace value="collapse" fixed="true"/>
</xs:restriction>
</xs:simpleType>Description
The value space of xs:base64Binary consists of arbitrary binary content. The lexical space is the same set after base64 encoding, described in Section 6.8 of RFC 2045.
Restrictions
RFC 2045 was designed to transmit binary content through text-based mail systems. It requires a line break after at most 76 characters to prevent mail systems from inserting uncontrolled breaks. Sending base64 content without line breaks is nevertheless common in applications such as SOAP and W3C XML Schema. At other W3C working groups’ request, the W3C XML Schema Working Group removed the line-break requirement from lexical-space conditions. This decision came after the W3C XML Schema recommendation’s publication and was to be listed in an errata edition.
Example
<xs:element name="picture">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="type" type="graphicalFormat"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de