You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by rpcee <rp...@operamail.com> on 2001/11/28 10:03:17 UTC

sax to dom to sax

How can I create a org.w3c.Document from a SAX producer, then generate SAX 
events from (traversing) that Document. Does xerces support that directly or 
do I use xalan/TrAX identity transform along the lines of transform(SAXSource, 
DOMResult) then transform(DOMSource, SAXResult)?

Thanks, Rich


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: sax to dom to sax

Posted by Larry Kline <la...@epropose.com>.
I'm not sure if this is exactly what you want to do but I did something
similar by doing this:

I wrote my own DocumentHandler that handled all of the SAX events I was
interested in and configured my SAXParser to use this handler.  In the
document handler methods I just used an XMLSerializer to send SAX events
to.  I was doing a fairly simple transformation of the files and did not
want to get into the intricacies of XSLT.

- Larry

At 04:03 AM 11/28/2001 -0500, you wrote:
>How can I create a org.w3c.Document from a SAX producer, then generate SAX 
>events from (traversing) that Document. Does xerces support that directly or 
>do I use xalan/TrAX identity transform along the lines of
transform(SAXSource, 
>DOMResult) then transform(DOMSource, SAXResult)?
>
>Thanks, Rich
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
Larry Kline
larry.kline@epropose.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: sax to dom to sax

Posted by Paul Brown <pr...@fivesight.com>.
> [rpcee at operamail.com]
> Subject: sax to dom to sax
> How can I create a org.w3c.Document from a SAX producer, then
> generate SAX events from (traversing) that Document?

Is that what you really want to do, or do you want to simply have two
consumers of the SAX events, one of whom is building a DOM?  Check out the
SAX project on SourceForge for some examples of how to split up events.

Xerces does have serialization classes, but if you're willing to do without
some of the configuration features, you'll be much better off (and more
portable) using TrAX identity transformations.

	-- Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org