Skip to Main Content
SAX2
book

SAX2

by David Brownell
January 2002
Intermediate to advanced content levelIntermediate to advanced
240 pages
6h 58m
English
O'Reilly Media, Inc.
Content preview from SAX2

Installing a SAX2 Parser

Unless you use JDK 1.4 (which bundles SAX2 and the Crimson parser) or some other environment that’s already set up with SAX2 support (such as any up-to-date web application server), you will need to update your Java programming environment so that you can use SAX. Consult the documentation that comes with your parser and Java Virtual Machine for specific details. Assuming the SAX interfaces and your SAX parser are distributed in a single JAR file called xml.jar (you’ll need to know and use the correct full pathname, including the directory), you’ll probably use one of these approaches shown in the following list.

Add to extensions directory

If you use JDK 1.2 or later for your runtime environment,[6] you can install the JAR file into the jre/lib/ext subdirectory of your Java distribution. This is the preferred solution during development, since it’s the simplest and least error-prone.

On Windows, you may need to add this to two different locations: one for the development environment as well as one for the runtime environment.

Update class path on command line

This solution works with JDK 1.2 and later. Whenever you invoke a program that needs the SAX support (such as java, javac, or javadoc) pass the -cp xml.jar parameter to add SAX to the class path.

Add to CLASSPATH in environment

This is the original way to add software to your Java environment, and it works on a JDK 1.1-based system and on many Java implementations that aren’t derived from Sun’s ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Special Edition Using XML, Second Edition

Special Edition Using XML, Second Edition

- et al. David Gulbransen

Publisher Resources

ISBN: 0596002378Supplemental ContentCatalog PageErrata