Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Exposing XMLHandler

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Alan Gutierrez <alan AT blogometer.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Exposing XMLHandler
  • Date: Thu, 27 Sep 2007 05:03:08 -0400

Alan Gutierrez wrote:
I am already using SAXConverter to generated SAX events.

I want to create an XOM document by consuming events. XOMHandler consumes SAX events and produces an XOM document. It also performs checks to prevent the creation of a malformed document, because if it were provided with an XMLFilter that XMLFilter could call ContentHandler methods out of order.

I still don't see the use case for doing this. What are you actually trying to do?

The XOMHandler is almost public as it is. I'm able to create a bogus XMLReader and pass it to a new Builder. Then I can get the ContentHandler and LexicalHandler from the XOMHandler. I can give the ContentHandler and LexicalHandler to the library that expects it. Then I can obtain the generated XOM document by calling the parse method of Builder, which in turn calls the do nothing parse method my bogus XMLReader and returns the XOM document created by manipulating the ContentHandler and LexicalHandler outside of the XMLReader.


That's fairly inspired or evil or both. I'll need to think about that.




--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page