[jdom-interest] Creating a SAXBuilder object for an XMLReader object

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon Jun 4 10:56:11 PDT 2001


SAXBuilder is a front end to get an XMLReader (called parser) instance
created for the JDOM specific SAXHandler (which is public in the current
version).  It doesn't really make sense to use SAXBuilder to use your own
XMLReader since once you have the reader configured, you may as well just
parse directly.  Ckeck out the build(InputSource) method of SAXBuilder and
you will see what I mean.

SAXHandler may be a good starting point for building your own XMLReader.




-----Original Message-----
From: Thomas Funck [mailto:funck at in.tum.de]
Sent: Monday, June 04, 2001 12:47 PM
To: jdom-interest
Subject: [jdom-interest] Creating a SAXBuilder object for an XMLReader
object


Dear all,

why isn't there a constructor for class SAXBuilder that takes an XMLReader
object (instead of the saxDriverClass string)? The reason is that I want to
create a SAXBuilder for a SAX1 parser. I wrap the SAX1 parser into a
org.xml.sax.helpers.ParserAdapter object, which is also an instance of
XMLReader. But for this XMLReader object I cannot create a SAXBuilder
object.
There is even no good possibility for defining an own subclass of
SAXBuilder, because the get()-methods for its attributes are missing. Also
class SAXHandler isn't visible outside its package.

Regards,

Thomas Funck



More information about the jdom-interest mailing list