Removes specified child node. : XML Node « XML « C# / C Sharp
- C# / C Sharp
- XML
- XML Node
Removes specified child node.
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' ISBN='1-111111-57-5'>" +
"<title>C#</title>" +
"</book>");
XmlNode root = doc.DocumentElement;
root.RemoveChild(root.FirstChild);
doc.Save(Console.Out);
}
}
Related examples in the same category