Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

All about JAXP, Part 1

By Brett McLaughlin
2005-07-15


Changing the parser

It's easy to change out the parser that the JAXP factory classes use. Changing the parser actually means changing the parser factory, because all SAXParser and DocumentBuilder instances come from these factories. The factories determine which parser is loaded, so it's the factories that you must change. To change the implementation of the SAXParserFactory interface, set the Java system property javax.xml.parsers.SAXParserFactory. If this property isn't defined, then the default implementation (whatever parser your vendor specified) is returned. The same principle applies for the DocumentBuilderFactory implementation you use. In this case, the javax.xml.parsers.DocumentBuilderFactory system property is queried.

Tutorial Pages:
» XML processing toolkit facilitates parsing and validation
» JAXP: API or abstraction?
» Starting with SAX
» Dealing with DOM
» Performing validation
» Changing the parser
» Summary
» Resources


First published by IBM developerWorks


 | Bookmark
Related Tutorials:
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT
» Java Validation With Dynamic Proxies

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources