Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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
Reply With Quote
  #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?
Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 02:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.