Aevi said:
I want to convert a DOM node x and its descendants into a SAX stream
and vice versa. has someone tried any of these two cases any help is
appreciated.
There really isn't any such thing as a SAX stream. There's an input Reader
that a SAX parser pulls data from, then calls callbacks that you write. The
closest thing to a SAX stream there is is an XML document.
If you write well-formed XML from your DOM model to an output Writer, you
could attach a Reader to the other end of it and use it as an XML InputSource.
But how would that help? If you are generating the XML you already have it,
and the data that it represents, so how does a SAX parser add value there?
Can't you just pull the information directly from your DOM model to whatever
needs it?