luni, 25 august 2014

AppendChild C# XML Example

AppendChild adds node to the end of the list of child nodes.

Example

XmlDocument doc = new XmlDocument();
doc.LoadXml(yourxml
); 
XmlNode root = doc.DocumentElement;
XmlElement elem = doc.CreateElement("price");
elem.InnerText = "100";
root.AppendChild(elem);

MessageBox.Show(root.OuterXml); 

Niciun comentariu:

Trimiteți un comentariu