Laura Neitzel wrote: > > I am relatively new to using XML Parsers (and SAX) and need someone to > explain how Sun and JAXP fit into the picture. > > I am currently developing with the Xerces Parser, whose xerces.jar includes > the org.xml.sax classes (i am using sax as opposed to dom). The XML4J > distribution that i have also looked at includes all of the Xerces classes, > plus a few of its own. > > My question concerns the recent JAXP release/immediate availability. I've > downloaded the it and the only difference between it and the Xerces > distribution deals with the parser (javax.xml.parsers - xml.tree, > xml.parser, and xml.util). I'm confused because I don't understand what Sun > has added that I don't get with Xerces (or XML4J, etc.). In other words, > what benefit am i getting by using Sun's jar files and "plugging in" the > Xerces parser (and also using the xerces.jar)? They both contain the core > org.xml classes and I still have to set validation manually through the > Xerces parser, right (if i want it to validate against a dtd or schema)? So, > how is that pluggable? What's the benefit? > > I realize that i am probably missing something BIG here in the grand scheme > of things, so i really need someone to point it out!
Actually you're missing a _very small_ detail... Nothing big at all :) As you know, out in this world there are several parsers doing the same damn thing: reading an XML file (or an URL) and parsing it... Some of them differ, some of them are pretty equal, some of them claim to be faster, some claim to be more "compliant", some just like to work with a partitcular implementation, but, most of us just want a stinkin "parser"... Sun, so, came out with a stupid, obvious but nedeed idea, to have just one entry point for all java parsers, the javax.xml.parsers classes. These are factories and wrappers that should be around ANY parser, and that basically let you deal with those, without caring if the parser you're using is com.sun.xml.parser.Parser or org.apache.xerces.Parser or foo.bar.my.Parser (I'm making up the class names right now). I like what they did, because they solved an immediate problem I had (some might say that DOM level 3 is already covering those issues, or the SAX parserfactory thing does the same job, but, I like what those guys did), and now I can write my applications without caring what parser is configured in my JVM, but timply accessing it thru the javax stuff... Pier (after 4 days on conference, still in tutorial mode!) BTW, Xerces, was the FIRST parser to support that standard, even before Sun itself did :) The javax.xml.parsers classes are in our codebase now! -- -------------------------------------------------------------------- - P I E R - stable structure erected over water to allow the docking of seacraft <mailto:[EMAIL PROTECTED]> <http://www.betaversion.org/~pier/> -------------------------------------------------------------------- - ApacheCON Y2K: Come to the official Apache developers conference - -------------------- <http://www.apachecon.com> --------------------