dcsimg
How do I store newly added node into existing xml file?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, July 8, 2003 02:31 AM


I have written the java code which adds nodes into existing xml file.I didn't use JDom for that.That is why i could not use XmlOutputter's output to file method to store added data.So ,how can i serialize or store the newly added contents to the xml file as i want existing data as well as newly added data to be get saved.Please ,help me .

Re: How do I store newly added node into existing xml file?

Posted By:   Stephen_McConnell  
Posted On:   Tuesday, July 8, 2003 05:05 AM

What is the internal representation of the XML file in your program? When you say that you add a node to the existing xml file, do you add it to the internal representation in the correct place.


Most parsers DOM, XDOM, JDOM have some class that will write the internal XML representation to an I/O stream. If you want to serialize the internal XML representation, to include the new node, you just overwrite the existing file with the new representation.


Stephen McConnell

About | Sitemap | Contact