[jdom-interest] SAXBuilder questions

Jason Hunter jhunter at collab.net
Thu Feb 22 22:25:09 PST 2001

"Rosen, Alex" wrote:
> (1) Wouldn't it be nice if there were a version of SAXBuilder that took an
> already-created XMLReader? Currently there doesn't seem to be a way that I can
> turn on arbitrary SAX features that aren't supported by the SAXBuilder API. I'd
> like to create an XMLReader myself, set it up however I'd like, and give it to
> SAXBuilder.

The reason we've elected not to do that is that many features of the
XMLReader need to be set a certain way for SAXBuilder to function.  If
you passed in an XMLReader we'd have to either take on faith that the
features were set properly (not a good solution, as our feature
selection may change over time without changing the API) or set the
features to guarantee proper functioning (not good either, as it changes
the passed-in parameter as a side effect).

> (2) Looking at the new JAXP support in SAXBuilder, I think it should use
> ClassLoader.loadClass() instead of Class.forName(). That gives it a better
> chance of finding the JAXP classes if they're loaded via a ClassLoader, rather
> than via the system classpath.

Great idea.  Will do.


More information about the jdom-interest mailing list