[jdom-interest] Opening SAXBuilder interface

Laurent Bihanic laurent.bihanic at atosorigin.com
Fri May 18 01:22:13 PDT 2001


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




More information about the jdom-interest mailing list