rob_botch
Full Member
  

Posts: 180 Reputation: 4
34 / / 
Joined: Apr 2006
|
RE: How to write to xml file?
To write to xml:
code: var xml = new ActiveXObject("Microsoft.XMLDOM"); //Create xml object
xml.load(XMLPath); //XMLPath is the path of your XML file
var toAdd = xml.createElement("Element"); //Create an element called "Element"
toAdd.appendChild(xml.createTextNode("Text")); //Add the text "Text" to the element that you just created
xml.getElementsByTagName("Parent")[0].appendChild(toAddMessage); //Add the newly created element to the first instance of "Parent"
xml.save(XMLPath); //Save the XML file to the path specified
I hope that this helps,
Robert
|
|