[jdom-interest] Feature Request

Jeremy.Prellwitz at siras.com Jeremy.Prellwitz at siras.com
Fri Feb 20 07:54:22 PST 2004

No, this WOULD solve my specific problem.

I can create a new Xerces parser as follows:      saxParser = new
SAXParser((XMLParserConfiguration) parserConfigClass.newInstance());
Where parseConfigClass =

My requested new feature, is to be able to pass in this Xerces SAXParser
object which i created myself into the constructor of SAXBuilder (or have a
setXMLReader(...) method).  It seems simple enough to just assign the
instance variable SAXBuilder.saxParser the new input object from the

Or alternatively, to be able to pass in the configuration class, and then
in the SAXBuilder.createParser(...) method, if the value of the configClass
was non-null, then it would be used in the default creation of the Xerces
SAXParser instance (as shown above.)

This would allow me to use the jdom SAXBuilder class without interfereing
with other code within my webapp (e.g. nekoHTML) which may rely on the
value of the Xerces system property.


             Elliotte Rusty                                                
             <elharo at metalab.u                                          To 
             nc.edu>                   Jeremy.Prellwitz at siras.com          
             Sent by:                                                   cc 
             jdom-interest-adm         jdom-interest at jdom.org              
             in at jdom.org                                           Subject 
                                       Re: [jdom-interest] Feature Request 
             02/20/2004 05:37                                              

At 6:52 PM -0800 2/19/04, Jeremy.Prellwitz at siras.com wrote:
>It is not NekoHTML that i'm worried about.  It is parsing regular XML
>documents in the same webapp.  Basically, NekoHTML interferes with the
>creation of Xerces parsers'.    When i create a SAXBuilder object, it
>creates a parser that is using the HTML configuration setup by NekoHTML.
>If I could create my own Xerces parser, and instantiate it with the
>specific standard configuration class that it needs, and then pass it into
>the constructor of the SAXBuilder object, then i don't have to worry about
>a the SAXBuilder object creating a parser on its own, that uses the HTML
>configuration setup by NekoHTML.

I agree this would be a more sensible approach for SAXBuilder. Indeed
it's what XOM does. However, this would not solve your specific
problem. Xerces does not allow you to set the parser configuration on
an specific XMLReader object. The parser configuration is a VM wide
property. See


   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)


To control your jdom-interest membership:

More information about the jdom-interest mailing list