XML DOM
XML DOM Contents
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:
Partners
Dream.In.Code dotNet Slackers dotNet Spider Your HTML Source VisualBuilder.com DevGuru Planet Source Code ZVON.ORG Web Design ASPAlliance XML Pitstop Scripts
The Spot 4 SAP Bitshop Web Hosting