Re: How to add Data to XML File ?
Monday, December 24, 2001 05:49 AM
parse the file into DOM document. once you have a Document with all the data from the file, create new elements (Element newElement = document.createElement("New Data")), add attributes to the new elements (newElement.setAttribute("persisted","true")) and associate a new element with the document (documentRootNode.appendChild(newElement)). use simple DOM API to append any new elements, alter current elements, delete current elements, ... it is very simple.