Name

xs:base64binary

Facets

xs:enumeration, xs:length, xs:maxLength, xs:minLength, xs:pattern, xs:whiteSpace

The xs:base64binary type is designed to contain information represented using the Base64 algorithm described in RFC 2045 (http://ietf.org/rfc/2045.txt). Base64 encoding allows applications to encode binary data as ASCII text and retrieve it again after transmission. The only characters allowed in Base64-encoded data are the letters AZ and az, the numbers 09, and the symbols plus (+) and slash (/). The encoding uses 4 bytes for every three of these characters. The data is represented in 76-character lines (because of its origins as part of the MIME mail rules) separated by line feeds. The equals sign (=) is used to pad lines if necessary.

Tip

The Base64 algorithm has been separated from RFC 2045 into a separate specification, RFC 3548 (http://ietf.org/rfc/3548.txt). While that’s a more convenient place to locate details of the algorithm, the XML Schema specification still normatively references RFC 2045.

While Base64 encoding is hardly an efficient means of transporting information, it is somewhat more efficient than the other type XML Schema provides for this task, xs:hexBinary.

Get XML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.