I've created DOM objects from a SAX ContentHandler before, it's not all that
difficult.

Simply create a class that implements the ContentHandler interface and then
as the SAX events occur, you build a DOM object that corresponds to the
event (e.g. characters () -> createTextNode (characterContent)).

There's at least one drawback though that I've found:

- SAX doesn't supply you with the DOCTYPE line so that you can create that
in your DOM Document

Brion Swanson

-----Original Message-----
From: Chad Loder [mailto:[EMAIL PROTECTED]
Sent: Monday, March 05, 2001 11:00 AM
To: [EMAIL PROTECTED]
Subject: Parsing documents over socket stream


Hello. I've read the FAQ entry which describes how to
parse documents in a "socket-friendly" way, without
over-buffering or over-reading or closing the stream.
http://xml.apache.org/xerces-j/faq-write.html#faq-11

I am wondering if it's possible to do a similar thing
with the DOMParser, because I can't see an easy way
to create a DOM Document object using a SAXParser.

Does anyone have any advice on this (either how to
do something similar with a DOMParser or how to plug
a content handler into the SAXParser so I can get a
DOM document out of it) ?

Thanks,
        Chad


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to