This section describes the built-in primitive datatype, 'hexBinary' that represents binary data represented in hexadecimal encoding. Leading and trailing whitespaces allowed and trimmed.
"hexBinary" is a built-in datatype that represents binary data encoded in hexadecimal format
with these rules:
The value space of "hexBinary" is any binary data.
The lexical space of "hexBinary" is hexadecimal encoding output strings.
Leading and trailing whitespaces allowed and trimmed.
To verify these rules, I wrote this simple XSD document that uses "hexBinary" datatype to declare XML elements:
When validating this XML document with my XsdSchemaValidator.java program presented earlier in the book,
I get 3 groups of errors for 3 invalid XML elements:
c:\Progra~1\Java\jdk1.7.0_07\bin\java XsdSchemaValidator
hexBinary_datatype_test.xsd hexBinary_datatype_test.xml
Error:
Line number: 13
Column number: 36
Message: cvc-datatype-valid.1.2.1: '123' is not a valid value for
'hexBinary'. (Must be multiples of 2 characters)
Error:
Line number: 13
Column number: 36
Message: cvc-type.3.1.3: The value ' 123 ' of element
'HexBinary' is not valid.
Error:
Line number: 14
Column number: 35
Message: cvc-datatype-valid.1.2.1: '4i' is not a valid value for
'hexBinary'. ("i" is not allowed)
Error:
Line number: 14
Column number: 35
Message: cvc-type.3.1.3: The value ' 4i ' of element
'HexBinary' is not
valid.
Error:
Line number: 15
Column number: 62
Message: cvc-datatype-valid.1.2.1: '6865726F6E67 79616E672E636F6D'
is not a valid value for 'hexBinary'. (Whitespace is not allowed)
Error:
Line number: 15
Column number: 62
Message: cvc-type.3.1.3: The value
' 6865726F6E67 79616E672E636F6D ' of element 'HexBinary' is
not valid.
Failed with errors: 6