BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XML DOM
How to select specific nodes in XmlDocument() when having a namespace ?
How to Load a XML From a String with XmlDocument?
How to remove an attribute with XmlDocument and RemoveAll?
How to create a navigator with XmlDocument and CreateNavigator?
Whats the 'push model'?
Hybrid Model Part Two: Choosing between SAX and DOM


 
 

<< XHTMLXmlSerializer >>


By Sonu Kapoor
First Posted 02/20/2005
Times viewed 3332

How to remove xml elements using RemoveChild() with XmlDocument?


Summary How to remove xml elements using RemoveChild() with XmlDocument?

In the other two examples in the XmlDocument section, you have seen how to add and update a xml file. To finish the three main tasks (add/update/delete) of data, I will cover in this example the deletion process. What I will show you is how you can delete specific nodes with the RemoveChild function. The RemoveChild() function is provided by the XmlNode class. So all we need to do is to find the appropriate node with the SelectSingleNode function and call the function on that. Here is how the XML looks before do any deletion:

XML This is a list my XML articles. true

After the deletion the XML file becomes this:

Additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XHTMLXmlSerializer >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML