[XOM-interest] Exposing XMLHandler

Elliotte Harold elharo at metalab.unc.edu
Thu Sep 27 05:03:08 EDT 2007


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/


More information about the XOM-interest mailing list