This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes DOM Document to xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DOM Document to xml" Watch "DOM Document to xml" New topic
Author

DOM Document to xml

Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
Hi,
I am creating a Document via the following
I then want to make some changes to the Document via the setNodeValue method.
I then want to transform the xml back into String. How do I do this ? When I call toString an my Document all I get is [#document: null].
Could write a bit of code meself but I figure there must be a way to do this, n'est pas ?
thanks,
D.
[ July 11, 2003: Message edited by: Don Kiddick ]
Pavel Halas
Ranch Hand

Joined: Jul 05, 2003
Posts: 35
When using JDOM classes (not in j2sdk), this could be done like this:


Be sure what type of Document you're using. This function works with org.jdom.Document, standard DOM Document could be converted into.
 
jQuery in Action, 2nd edition
 
subject: DOM Document to xml
 
Similar Threads
DOMParser
Recreate XML file
package problem
New to Java. Can you help with whit this (XML) ?
Validate XML against XSD using the Xerces DOM Parser