|
Helping ordinary people create extraordinary websites! |
All about JAXP, Part 1By Brett McLaughlin2005-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 |
|