Translate DOM to SAX and vice versa

A

Aevi

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.

-Aevi
 
L

Lew

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top