Last November, Tom Cargill lectured at the Denver Java User's Group about XML. He argued that Apache's XML parser was superior to JAXP, describing JAXP as being "in a state of flux." My notes indicate that the consensus in the DJUG crowd was that JAXP was a leaner JAR and was less flakey than Apache. Any strong opinions here? Bad stories about one or the other? [This message has been edited by Tim Berglund (edited January 22, 2001).]
Mainly the current JAXP is only compliant with DOM 1 and SAX 1. The next version is in beta test as I understand it can can be downloaded from the developer's site. In general, the Apache XML projects require the Apache parser because they are using interfaces from DOM 2 and SAX 2 Sun will have to become compatible with the next standards very quickly, but right now, you will need the Apache parser if you want to fool around with SOAP, Cocoon, or all the other Apache goodies. An exception is plain Tomcat which ships with JAXP - lots of confusion if you are using Tomcat with SOAP..... hopefully they will all get compatible quickly. Bill
And don't forget that the Resin web server and servlet container ships with a built in SAX2 and DOM2 parser, as well as a built-in fast compiling XSLT engine and an XML-RPC system which allows the calling of EJBs through HTTP. Why not check it out at http://www.caucho.com/ ?
Most people have difficulty in distinguishing between the Java API for XML parsing (JAXP) and Sun's XML parser. JAXP is just a higher-level abstraction API which consists of just 6 classes! It's true that JAXP ships with Sun's parser, but you can as well easily use the Xerces parser with JAXP without even needing to re-compile the existing code. JAXP mainly uses the Abstract Factory pattern which gives it this flexibilty & doesn't lock you in with a vendor's parser. Also note that the latest version 1.1 of JAXP does indeed support SAX2 and level 2 of DOM (although it's a bit late considering that SAX2 was finalized in May 2000). Also it comes with a new TRAX API (Transformation for XML) which will hopefully standardize the way XSL transformations are carried out.
posted 18 years ago
Now that bit about TRAX is interesting. I've been battling recently to include XML transformations in a vendor-independent way. I'll check it out.