How do I delete certain Nodes and elements from an XML file/string???

  • Thread starter Thread starter acool
  • Start date Start date
A

acool

If I have an XML file in a string variable what is the best way to go about
deleting specific Nodes or elements from this file??
 
XmlDocument or XmlTextReader/XmlTextWriter.

The easiest might be load the document, remove the node, then save it back
out. Or you could cycle through the nodes with the XmlTextReader, then only
write those that you want to keep.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top