XML Library Changes

When I wrote chapter 6, I used Sun's "Java Project X" experimental parser. Alot has happened in the XML parser world since then. Sun has made a major effort to create a parser library that does away with dependency on specific libraries.

For instance, my code in the book used:
 import com.sun.xml.parser.Resolver ;
and used a String with specific named parser class. The current approach is to use a ParserFactory or DocumentBuilderFactory in code like the following that depends on the factory to create a usable parser.
 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
 dbf.setValidating( false );
 DocumentBuilder db = dbf.newDocumentBuilder();
 Document doc = db.parse( xmlFile );
I have modified the Chapter 6 files that are affected by this change. You can download them here.

Some Current XML Parsers

Email to Bill Brogden.
This page© 2001 LANWrights, Inc., Austin, TX