This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Convert DOM Document back to XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Convert DOM Document back to XML file" Watch "Convert DOM Document back to XML file" New topic
Author

Convert DOM Document back to XML file

sony gam
Greenhorn

Joined: Jun 20, 2001
Posts: 28
Hi,
I have started to look into java API's for XML parsing.
My current need in my project is to take XML file, construct a JTree out of it, display it , allow users to manupulate the JTree and finally manipulate the XML file accordingly.
DOM/JDOM API seems to be the best fit for me.
I understand that we can use parse method to obtain a Document object.
But I did not find any API like XMLWriter which will convert the Document back to XML file. (I'm not talking about output to the screen)
I know that by using XMLOutputter with JDOM package or by creating our own XMLOutput class we can write to the modified Document object to the same file, but I want a more obvious solution like a parse call, which takes a Document object as input and gives a XML file.
Could you please help me???
Thanks,
Sony
[This message has been edited by sony gam (edited June 20, 2001).]
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5781
Take a look at my answer for a similar question in an older post.
Hope that helps you too!
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
 
 
subject: Convert DOM Document back to XML file
 
Threads others viewed
i need to create a xml file from Jtree
JAXB now or wait?
XML API choices, survey
JTree
XML to DOM to JTree
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture