Name
xsd:hexBinary — Binary contents coded in hexadecimal
Synopsis
<xsd:simpleType name="hexBinary” id="hexBinary"> <xsd:restriction base="xsd:anySimpleType"> <xsd:whiteSpace value="collapse” fixed="true"/> </xsd:restriction> </xsd:simpleType>
Derived from
xsd:anySimpleType
Primary
xsd:hexBinary
Known subtypes
None
Data parameters (facets)
enumeration, length,
maxLength, minLength,
pattern
Description
The value space of xsd:hexBinary is the set of all
binary contents; its lexical space is a simple coding of each octet
as its hexadecimal value.
Restrictions
This datatype shouldn’t be confused with another encoding called BinHex, which isn’t supported by the W3C XML Schema. Other popular binary text encodings (such as Quote Printable, uuXXcode, BinHex, aencode, or base85, to name a few) aren’t supported by the W3C XML Schema.
The expansion factor is high because each binary octet is coded as two characters (i.e., four octets if the document is encoded with UTF-16).
Example
A UTF-8 XML header such as:
"<?xml version="1.0" encoding="UTF-8"?>"
encoded is:
"3f3c6d78206c657673726f693d6e3122302e20226e656f636964676e223d54552d4622383e3f"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access