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


HOME |  BOOKS |  TRAINING |  CERTIFICATION |  JAVA SHOWCASE |  About LanWrights |  Overview




NOTICE:
You can signup for the new lanw forums, and begin contributing to our new look website from spring 2007 onwards.

Last edited 1st March 2007.