Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 26th, 2004, 10:44 AM
Registered User
 
Join Date: Feb 2004
Location: Dhaka, , Bangladesh.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tutul128
Default Add and Remove Nodes in XML document.

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
  #2 (permalink)  
Old February 26th, 2004, 10:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

What programming language are you using to manipulate your XML?
  #3 (permalink)  
Old February 26th, 2004, 11:19 AM
Registered User
 
Join Date: Feb 2004
Location: Dhaka, , Bangladesh.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tutul128
Default

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.I am using JavaScript. Will you please help me.
                                                 Tutul.

Hassanur
Hassanur
  #4 (permalink)  
Old March 1st, 2004, 10:17 AM
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual dropdown lists, add and remove Endelee Classic ASP Basics 1 May 4th, 2007 03:31 AM
problem accessing nodes using document() and id() siris phi XSLT 3 April 12th, 2007 11:05 PM
How do I remove xmlns from transformed document? Matt Ruby XSLT 2 October 27th, 2005 08:20 AM
Copying XML nodes from one document to another hughcr C# 2 May 12th, 2005 01:20 AM
asp boxlist add/remove lip13 Classic ASP Basics 1 December 10th, 2004 06:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.