Hi, i think this simple code will help you...
this code insert a node using DOM and JavaScript. To remove use removeChild method, but I can not do.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var root;
var newNode;
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("document.xml");
try
{
root = xmlDoc.documentElement;
alert(root.xml);
newNode = xmlDoc.createNode(1, "newNode", "");
root.appendChild(newNode);
alert(root.xml);
}
catch(e)
{
alert("error");
}
}
Quote:
quote:Originally posted by tutul128
Hi friends,
I can not insert elements into an XML document.What is the procedure to delete a node. Will you please help me.
Tutul.
Hassanur
|
Thiago Falcão