How to save XML file using JScript/DOM in IE
I'm a new member to this group, I'm having a bit of a problem with the IXMLDocument's save method and I'm not sure how to fix it.
At the end of the script I used the line "alert(xmlDoc.xml)" to see that my XML has been revised (this is for debugging only) and then use the line "xmlDoc.save(filename)". I'm able to see my expected changes in alert but not in xml file on disk.
The problem here is XMLDoc.Save(filename) is not intended for use from a secure client, such as MicrosoftÂ® Internet Explorer. I can able to save to file from View mode in Visual Studio InterDev 6.0. Can anybody help me to save xml file using JScript and DOM without using Server objects. I put security level to low for IE 6.0 on my work station.
I am trying to do a simple GuestBook for my site using XML, almost finished this except for this problem and have wasted countless hours trying different things and scouring the web for help. If anyone out there can help me with this, I would greatly appreciate it.
Here is the function I'm using:
var xmlDoc, xmlPersist
xmlDoc= new ActiveXObject("msxml2.DOMDocument.4.0")
xmlDoc.validateOnParse = true
xmlDoc.async = false
root = xmlDoc.documentElement
Node = xmlDoc.createNode(1, "Guest", "")
nodeP = xmlDoc.createAttribute("confidential")
NodeN=xmlDoc.createNode(1, "Name", "")
NodeE=xmlDoc.createNode(1, "Email", "")
NodeW=xmlDoc.createNode(1, "Website", "")
NodeC=xmlDoc.createNode(1, "Comments", "")
// working fine..
xmlDoc.save("GuestBook2.xml") // can't use filename as IE won't allow
alert("Something getting wrong")