Append element
using System;
using System.Xml;
class MainClass
{
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='programming'>" +
"<title>Programming</title>" +
"</book>");
XmlNode root = doc.DocumentElement;
XmlElement newbook = doc.CreateElement("price");
newbook.InnerText="44.95";
root.AppendChild(newbook);
doc.Save(Console.Out);
}
}
Output Programming
44.95
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
|