Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Consider adding Builder.getXMLReader()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: John Cowan <jcowan AT reutershealth.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Consider adding Builder.getXMLReader()
  • Date: Fri, 10 Oct 2003 17:24:39 -0400

At 5:02 PM -0400 10/10/03, John Cowan wrote:

I do most strongly urge you *not* to do this. One of the great virtues
of SAX is that it's straightforward to write SAX parsers that accept
formats other than XML, and then allow the rest of the application
to treat the input as XML. There are already some very interesting
SAX parsers out there: one that accepts WIN.INI format, for example.
It would be easy to convert parts of Jing into a SAX parser for DTDs or
for RELAX NG compact syntax. I have myself written a SAX parser that
understands phpwiki syntax and reports it as XHTML. Because SAX is
interface-based, making such parsers hot-pluggable is trivial.


That's a good use-case. I myself have written a JDBC reader that exposes SAX events from any SQL query. See http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
However, I wonder if I should move that functionality off into nu.xom.converters, either as part of SAXConverter or as a new class. I'd still like to not pollute the main nu.xom API with SAX classes if I can help it.

Also, doing this might give me a heads-up that the XMLReader is not really checking well-formedness and might be doing bad things like passing in C0 control characters. When I wrote my JDBC reader I was very careful to filter illegal characters. However, I'm not convinced everyone else is being equally careful.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page