Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

Translate DOM to SAX and vice versa

Thread view: 
Aevi - 26 Mar 2008 23:25 GMT
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
Lew - 27 Mar 2008 05:02 GMT
> 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?

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.