[jdom-interest] Opening SAXBuilder interface

Jason Hunter jhunter at collab.net
Thu May 17 14:20:21 PDT 2001


Laurent Bihanic wrote:
> 
> Hi,
> 
> Another request for some API changes !
> 
> Context: Using JDOM on a project that has a strong SAX legacy ;-)
> 
> Request #1: Make build(InputSource) public

Good idea.  No objection here.  Anyone else?

> Request #2: Add a public method build(InputSource, XMLReader).
> Use case: Allow reuse of weird XMLReaders, e.g. a "XMLReader" that takes a
> fixed-width COBOL file and present a XML view of it. No, I can't use "new
> SAXBuilder(className)" because the reader need extra configuration prior being
> usable for parsing. Of course, the reader shall accept all the setProperty,
> setFeature and setXxxHandler JDOM requires to configure the parser.

This one's a little tricky, because of the special requirements JDOM has
on XML readers to set certain flags certain ways.  I suppose if we had
the code in SAXBuilder beginning on line 300 run on the reader passed
in, then it's fairly safe.  But isn't it a little improper for us to
tweak setting on a passed-in XMLReader?

-jh-



More information about the jdom-interest mailing list