Michael Ludwig
2010-02-07 21:33:42 UTC
The documentation for those constructors of nu.xom.Builder that take an
instance of org.xml.sax.XMLReader as first parameter promises that the
resulting builder will read data from the specified parser object.
Not quite true.
Maybe the documentation should reflect the fact that XOM will replace an
existing ContentHandler and put its own ContentHandler in place. So if
the user wants to control the parsing process, he should supply an
XMLFilter, not an XMLReader.
* Don't care what parser? Don't supply any.
* Want a specific parser, like Xerces? Supply an implementation class of
XMLReader without setting up any handlers on it.
* Want specific parsing behaviour? Supply your custom XMLFilter wrapping
a stock XMLReader of your choice.
instance of org.xml.sax.XMLReader as first parameter promises that the
resulting builder will read data from the specified parser object.
Not quite true.
Maybe the documentation should reflect the fact that XOM will replace an
existing ContentHandler and put its own ContentHandler in place. So if
the user wants to control the parsing process, he should supply an
XMLFilter, not an XMLReader.
* Don't care what parser? Don't supply any.
* Want a specific parser, like Xerces? Supply an implementation class of
XMLReader without setting up any handlers on it.
* Want specific parsing behaviour? Supply your custom XMLFilter wrapping
a stock XMLReader of your choice.
--
Michael Ludwig
Michael Ludwig