Wiley Professional XML Development with Apache Tools: Xerces, Xalan, FOP, Cocoon, Axis, Xindice 978-0-7645-4355-5 用户手册

产品代码
978-0-7645-4355-5
下载
页码 52
Xerces
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 impor-
tant XML standards:
XML 1.0, Second Edition
XML Namespaces
SAX 2.0
DOM Level 1
DOM Level 2 (Core, Events, Range, and Traversal)
1
1
1
01 543555 Ch01.qxd  11/5/03  9:40 AM  Page 1