Gets the first child of the node. : XML Node « XML « C# / C Sharp
- C# / C Sharp
- XML
- XML Node
Gets the first child of the node.
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book ISBN='1-111111-57-5'>" +
"<title>C#</title>" +
"<price>19.95</price>" +
"</book>");
XmlNode root = doc.FirstChild;
Console.WriteLine("Display the title element...");
Console.WriteLine(root.FirstChild.OuterXml);
}
}
Related examples in the same category