Hi
I am working on a DHTML task where i need to manupulate a XML File content where i need create a extra attribute for some Xml Node in a XMLNodeList.I am doing all this thing using xmlDoc=new ActiveXObject(“Microsoft.XMLDOM”);
But after all manupulation is done i am not getting the changes in the Original XML file which is residing in my local Disk.
tHE Code as follows
[code]
function ExtractDataFromXML()
{
try
{
var ambAmb =Window.External; // calling my C# EXTERNAL class from a webbroser control
var CycleId = “1”;
var searchCycle = “//cycle[@cid = ” + ‘”‘ + CycleId + ‘”‘ + “]”;
var vals=ambAmb.CreateAndParseXMLDoc(); //vals is the path of xml document in the diskfile like c:demo.xml
xmlDoc=new ActiveXObject(“Microsoft.XMLDOM”);
xmlDoc.async=”false”;
try
{
xmlDoc.load(vals.toString()); //
var rootElement = xmlDoc.firstChild;
var objCycle = rootElement.selectSingleNode(searchCycle);
var objWorksheets = objCycle.selectNodes(“.//worksheet”);
var objWorksheet;
var currentGuid;
//var dt = new Date();
//var fmtDate = formatDate(dt, “MM/dd/yyyy hh:mm:ss”);
for (i=0; i<objWorksheets.length; i++) {
var newatt=xmlDoc.createAttribute(“deleteddate”);
newatt.nodeValue=”xyz”;
objWorksheet = objWorksheets.item(i);
objWorksheet.setAttributeNode(newatt);
}
alert(“Done”);
But the problem is that No changes takes place in physical path and when i try to put xmlDoc.save() or xmlDoc.save(vals) it showing object error.
Can anybody tell me what i am doing wrong here.
Thanks
__Das