Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting from XML Tags

Status
Not open for further replies.
Aug 1, 2005
25
US
Hi

Any code to help delte from a tag(s) from an xml doc

Doin the coding in asp.net

Many thanks!!!

 
Have you actually tried using google or MSDN?
Code:
XmlDocument xml = new XmlDocument();
xml.LoadXml("<grub><pizza><topping>sausage</topping><topping>onions</topping></pizza><hotd><topping>ketchup</topping><topping>onions</topping></hotd></grub>");

XmlNode node = xml.SelectSingleNode("grub/pizza");
node.RemoveChild(node.ChildNodes[0]);
MessageBox.Show(xml.InnerXml);

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top