Chapter 1: Xerces


Overview

XML parsing is the foundational building block for every other tool we’ll be looking at in this book. You can’t use Xalan, the XSLT engine, without an XML parser because the XSLT stylesheets are XML documents. The same is true for FOP and its input XSL:FO, Batik and SVG, and all the other Apache XML tools. Even if you as a developer aren’t interacting with the XML parser directly, you can be sure that each of the tools you describe makes use of an XML parser.

XML parsing technology is so important that the ASF has two XML parsing projects: Xerces and Crimson. The reason for this is historical. When the ASF decided to create http://xml.apache.org, both IBM and Sun had Java-based XML parsers that they wanted to donate to the project. The IBM parser was called XML for Java (XML4J) and was available in source code from IBM’s AlphaWorks Website. The Sun parser was originally called Project X. The code base for IBM’s XML4J parser became the basis for Xerces, and the code base for Project X became the basis for Crimson. The goal of the parsing project was to build a best-of-breed parser based on the ideas and experience of XML4J and Project X. This did not happen right away; it wasn’t until late in 2000 that a second-generation Xerces effort was begun.

Throughout this chapter and the rest of this book, we’ll use Xerces for Java 2 (hereafter Xerces) as our parser. Xerces for Java 2 is replacing both Xerces for Java 1 and Crimson. At the time of this writing, the plan is for a version of Xerces to be the reference implementation for XML parsing in the Sun Java Developer’s Kit (JDK). Xerces is a fully featured XML parser that supports the important XML standards:

  • XML 1.0, Second Edition

  • XML Namespaces

  • SAX 2.0

  • DOM Level 1

  • DOM Level 2 (Core, Events, Range, and Traversal)

  • Java APIs for XML Parsing 1.2

  • XML Schema 1.0 (Schema and Structures)

The current release of Xerces (2.4.0) also has experimental support for:

  • XML 1.1 Candidate Recommendation

  • XML Namespaces 1.1 Candidate Recommendation

  • DOM Level 3 (Core, Load/Save)

    Note

    A word about experimental functionality: one of the goals of the Xerces project is to provide feedback to the various standards bodies regarding specifications that are under development. This means the Xerces developers are implementing support for those standards before the standards are complete. Work in these areas is always experimental until the specification being implemented has been approved. If you need functionality that is documented as experimental, you may have to change your code when the final version of the specification is complete. If the functionality you need is implemented only in an experimental package, be aware that the functionality may change or be removed entirely as the standards process continues. A good example is abstract support for grammars (both DTDs and XML Schema), which was supposed to be part of DOM Level 3. However, the DOM Working Group decided to cease work on this functionality, so it had to be removed from Xerces. This is a rare and extreme occurrence, but you should be aware that it has happened. Most situations are less severe, such as changes in the names and signatures of APIs.




Professional XML Development with Apache Tools. Xerces, Xalan, FOP, Cocoon, Axis, Xindice
Professional XML Development with Apache Tools: Xerces, Xalan, FOP, Cocoon, Axis, Xindice (Wrox Professional Guides)
ISBN: 0764543555
EAN: 2147483647
Year: 2003
Pages: 95

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net