Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you save changes to xml document

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I was able to load an XML document with javascript and make some changes to it and then validate them. Now how do I save those changes I made interacively with javascript?
 
If I understand your problem, you`ll have to rewrite the xml file (output the dom tree) and then reload it.
 
The previous poster is right. You have to write the file back in order to save it. You probably don't need to reload it if you made the changes to your document object. It should still be valid.

Uura
~~~~
"Common sense tells you that the world is flat."
 
if you are using Microsoft.XMLDOM parser, then the code is

var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("somefile.xml")

//do some changes

//save file
xml.save("somefile.xml")

 
Thanks for the help everyone. Whichman I have been trying this with the original file and the same file and I am getting a permission denied error. Why is that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top