[jdom-interest] Is JDOM parser independent?

Matthew MacKenzie matt at xmlglobal.com
Sun Feb 18 18:40:35 PST 2001

Yes and no.

org.jdmom.input.SAXBuilder is parser independent in that if the parser is 
SAX compliant, it should work.  If the parser isn't SAX compliant, you need 
to write an inputter for it likely.

... however, you can probably not just swap the parser without modifying 
the string that SAXBuilder is passed to decide which parser it should build 
its Document with.  If you want to hot swap parsers, you will need to 
derive the SAX Parser class from the environment, or a config file, e.g.

// requires that you set the environment variable SAX_BUILDER_CLASS
String SAX_BUILDER_CLASS = System.getProperty("SAX_PARSER");
SAXBuilder builder;

if (SAX_BUILDER_CLASS != null) {
    builder = new SAXBuilder(SAX_BUILDER_CLASS);
} else {
    // use xerces is the env var wasn't set.
    builder = new SAXBuilder();



<<| message from: "KunHee Lee" <lovesoon at hotmail.com> |>>
If it is, then can I use the previous class file, when I changed my parser?
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-
interest/youraddr at yourhost.com
<<| end message from "KunHee Lee" <lovesoon at hotmail.com> |>>

Matthew MacKenzie
VP Research & Development, Founder
XML Global Technologies, Inc.

More information about the jdom-interest mailing list