This section provides a quick introduction of Xerces2 and a tutorial of downloading and installing Xerces2 2.11.0 beta to support XSD 1.1.
Xerces2 Java Parser? Xerces2 Java Parser is an open source Java API of XML parsers.
Xerces2 Java Parser supports XML standards, XInclude, DOM, SAX, JAXP, and XML Schema.
The current version of Xerces2 Java Parser is release 2.11.0, which
supports the following standards and APIs:
eXtensible Markup Language (XML) 1.0 Fourth Edition Recommendation
Namespaces in XML 1.0 Second Edition Recommendation
eXtensible Markup Language (XML) 1.1 Second Edition Recommendation
Namespaces in XML 1.1 Second Edition Recommendation
XML Inclusions (XInclude) Version 1.0 Second Edition Recommendation
Document Object Model (DOM) Level 3 Core, Load and Save, (DOM) Level 2 Core, Events, and Traversal and Range Recommendations
Element Traversal First Edition Recommendation
Simple API for XML (SAX) 2.0.2 Core and Extensions
Java APIs for XML Processing (JAXP) 1.4
Streaming API For XML (StAX) 1.0 Event API (javax.xml.stream.events)
XML Schema 1.0 Structures and Datatypes Second Edition Recommendations
XML Schema 1.1 Structures and Datatypes Working Drafts (December 2009)
XML Schema Definition Language (XSD): Component Designators (SCD) Candidate Recommendation (January 2010)
Xerces2 is integrated into JDK 1.7 through the JAXP API now.
It is recommended to perform XML Schema validation using JAXP API instead of using Xerces2 directly.
See other chapters in this book for JAXP tutorial examples.
However the latest version of Xerces2 for XSD 1.1 support, Xerces2 2.11.0 (XML Schema 1.1) (Beta),
is not integrated into JDK yet.
So if you want to play with XSD 1.1 features, you need to install the
Xerces2 Java 2.11.0 XML Schema 1.1 Beta version on your local computer.
Here are the steps:
1. Go to the Xerces2 Java Parser home page: http://xerces.apache.org/xerces2-j/.
2. Click the menu link "Download", then click the "Binary Distributions" link.
3. Click the "Xerces2 Java 2.11.0 (XML Schema 1.1) (Beta) - zip" link to start the download.
4. Save the downloaded file to \temp\Xerces-J-bin.2.11.0-xml-schema-1.1-beta.zip.
5. Unzip \temp\Xerces-J-bin.2.11.0-xml-schema-1.1-beta.zip, then move and rename the resulting directory
6. Locate the JAR file \local\xerces-2_11_0-xml-schema-1.1-beta\xercesImpl.jar to make sure
that the installation was done correctly.
For comparison reason, I also downloaded and installed the regular version of Xerces 2.11.0 in