[jdom-interest] Opening SAXBuilder interface

Jason Hunter jhunter at collab.net
Fri Jun 22 00:48:42 PDT 2001


Laurent Bihanic wrote:
> 
> Jason Hunter wrote:
> 
> > 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?
> >
> Well, it's a choice between:
>   1. Do not alter the XMLReader settings and state in the JavaDoc what's the
> required settings for JDOM to work properly
>   2. State in the JavaDoc that JDOM will reconfigure the parser.
> 
> I don't have any objections about JDOM altering the parser settings as JDOM
> requirements are fairly low: JDOM actually only requires namespace support.
> Besides that, validation can be controlled through SAXBuilder and XMLFilters
> can be used to accept JDOM Content/DTD/Error/Lexical-handlers while still
> having applications-specific ones.
> Just need to make sure the programmer is aware of it.
> 
> By the way, talking about filters, if SAXBuilder accepts application-provided
> parsers, it should also check and use any ultimate parent XMLReader attached
> to the filter chain set through setXMLFilter().

Laurent, does the recent refactoring of SAXBuilder, where there's a
protected XMLReader createParser() method, solve this issue sufficiently
for you?  Or do you want to continue pursuing a build(XMLReader)
approach?

-jh-



More information about the jdom-interest mailing list