View RSS Feed

Java XML


Rate this Entry
by , 04-27-2012 at 06:05 PM (498 Views)
The main JAXP APIs are defined in the javax.xml.parsers package. That package contains vendor-neutral factory classes,SAXParserFactory, DocumentBuilderFactory, and TransformerFactory, which give you a SAXParser, aDocumentBuilder, and an XSLT transformer, respectively. DocumentBuilder, in turn, creates a DOM-compliant Documentobject.

The factory APIs let you plug in an XML implementation offered by another vendor without changing your source code. The implementation you get depends on the setting of the javax.xml.parsers.SAXParserFactory,javax.xml.parse rs.DocumentBuilderFactory, and javax.xml.transform.TransformerFactory system properties, using System.setProperties() in the code, <sysproperty key="..." value="..."/> in an Ant build script, or -DpropertyName="..." on the command line. The default values (unless overridden at runtime on the command line or in the code) point to Sun's implementation.

Submit "The JAXP APIs" to Facebook Submit "The JAXP APIs" to Digg Submit "The JAXP APIs" to Submit "The JAXP APIs" to StumbleUpon Submit "The JAXP APIs" to Google