This section provides an example XML file associated with an example XSD 1.1 file. The XML file contains some errors intentionally for see how XML validation tools report them.
Now I have a tool to validate XML documents against XSD 1.1 schema.
I created a XSD 1.1 schema file, xsd11_datatype_test.xsd, with more new datatypes introduced in XSD 1.1.
When I run jaxp.SourceValidator on xsd11_datatype_test.xml,
I get the following output:
>jdk8x2r jaxp.SourceValidator -xsd11 -i xsd11_datatype_test.xml
[Error] xsd11_datatype_test.xml:17:67: cvc-type.3.1.2: Element
^^^ 'AnyAtomicType' is a simple type, so it must have no element
^^^ information item [children].
[Error] xsd11_datatype_test.xml:23:51: cvc-datatype-valid.1.2.1: '?'
^^^ is not a valid value for 'dateTimeStamp'.
[Error] xsd11_datatype_test.xml:23:51: cvc-type.3.1.3: The value
^^^ ' ? ' of element 'DateTimeStamp' is not valid.
[Error] xsd11_datatype_test.xml:29:65: cvc-datatype-valid.1.2.1:
^^^ 'P1Y2M3DT5H20M30.123S' is not a valid value for 'dayTimeDuration'.
[Error] xsd11_datatype_test.xml:29:65: cvc-type.3.1.3: The value
^^^ ' P1Y2M3DT5H20M30.123S ' of element 'DayTimeDuration' is not
^^^ valid.
[Error] xsd11_datatype_test.xml:35:69: cvc-datatype-valid.1.2.1:
^^^ 'P1Y2M3DT5H20M30.123S' is not a valid value for
^^^ 'yearMonthDuration'.
[Error] xsd11_datatype_test.xml:35:69: cvc-type.3.1.3: The value
^^^ ' P1Y2M3DT5H20M30.123S ' of element 'YearMonthDuration' is
^^^ not valid.
xsd11_datatype_test.xml: 96 ms
Good. jaxp.SourceValidator reported all errors correctly with
line numbers and column numbers indicate where errors occurred
in the XML source document.