XML Schema Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.00

Installing Xerces2 Java Parser

This section provides a quick introduction of Xerces2 and a tutorial of downloading and installing Xerces2.

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.9.1, 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
  • Simple API for XML (SAX) 2.0.2 Core and Extensions
  • Java APIs for XML Processing (JAXP) 1.3
  • XML Schema 1.0 Structures and Datatypes Second Edition Recommendations

Xerces2 is integrated into JDK 1.6 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.

But if you really want to install Xerces2 Java Parser to your local computer and try it, you can follow the steps bellow:

1. Go to the Xerces2 Java Parser home page: http://xerces.apache.org/xerces2-j/.

2. Click the menu link "Download", then click the "master distribution directory" link. You will see a list of files for downloading.

3. Click the "Xerces-J-bin.2.9.1.zip" link to start the download.

4. Save the downloaded file to \temp\Xerces-J-bin.2.9.1.zip.

5. Unzip \temp\Xerces-J-bin.2.9.1.zip, then move the resulting directory to \local\xerces-2_9_1.

6. Locate the JAR file \local\xerces-2_9_1\xercesImpl.jar to make sure that the installation was done correctly.

Sections in This Chapter

Installing Xerces2 Java Parser

Testing Examples of XSD File and XML File

XML Schema (XSD) Validation using XMLReader

XML Schema (XSD) Validation using SAXParser

Dr. Herong Yang, updated in 2007
Installing Xerces2 Java Parser