This section provides a tutorial example on new built-in datatypes introduced in XSD 1.1 and on validating XSD 1.1 schema with the XMLReader class from Xerces2. 2.11.0.
The previous tutorial showed us how to use the XMLReader class in "Xerces2 2.11.0 (XML Schema 1.1) (Beta)" version
to validate XML document again XSD document.
But the XSD document used, dictionary.xsd, does not use any XSD 1.1 features.
In order to test XSD 1.1 features with "Xerces2 2.11.0 (XML Schema 1.1) (Beta)",
I wrote this sample XSD document that uses 4 built-in datatypes introduced in XSD 1.1:
When running the XMLReader class tool, XMLReaderValidator.java,
I get this error:
c:\Progra~1\Java\jdk1.7.0_07\bin\java
-cp ".;c:\local\xerces-2_11_0-xml-schema-1.1-beta\xercesImpl.jar;
c:\local\xerces-2_11_0-xml-schema-1.1-beta
\org.eclipse.wst.xml.xpath2.processor_1.1.0.jar"
XMLReaderValidator xsd11_datatype_test.xml
Error:
Public ID: null
System ID: file:///C:/herong/xsd11_datatype_test.xsd
Line number: 10
Column number: 29
Message: src-resolve.4.2: Error resolving component
'xs:anyAtomicType'. It was detected that 'xs:anyAtomicType' is in
namespace 'http://www.w3.org/2001/XMLSchema', but components from
this namespace are not referenceable from schema document
'file:///C:/herong/xsd11_datatype_test.xsd'. If this is the
incorrect namespace, perhaps the prefix of 'xs:anyAtomicType' needs
to be changed. If this is the correct namespace, then an
appropriate 'import' tag should be added to
'file:///F:/herong/xsd11_datatype_test.xsd'.
Error:
Public ID: null
System ID: file:///C:/herong/xsd11_datatype_test.xsd
Line number: 10
Column number: 29
Message: src-resolve: Cannot resolve the name 'xs:anyAtomicType'
to a(n) 'type definition' component.
I am confused with this error.
What does it mean that 'xs:anyAtomicType' is in the namespace, but
components are not referenceable? See next tutorial for the answer.