View Single Post
  #4 (permalink)  
Old March 1st, 2004, 10:17 AM
tfalcao tfalcao is offline
Registered User
 
Join Date: Mar 2004
Location: Manaus, Amazonas, Brazil.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to tfalcao
Default

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