Hello all
Anyone have or know where I can get some sample code in VB.Net to delete and update XML elements.
Matthew Nace
[email protected]
Printable View
Hello all
Anyone have or know where I can get some sample code in VB.Net to delete and update XML elements.
Matthew Nace
[email protected]
Scroll down to the XML section:
http://samples.gotdotnet.com/quickstart/howto/
Here is a simple example in C#:
Code:using System;
using System.Xml;
class XmlExample
{
static void Main()
{
XmlDocument xSource = new XmlDocument();
XmlElement xBook = xSource.CreateElement("Book");
xBook.InnerText = "C# Rocks!";
xSource.AppendChild(xSource.CreateElement("BOOKS"));
xSource.DocumentElement.AppendChild(xBook);
Console.WriteLine(xSource.InnerXml);
xSource.DocumentElement.RemoveChild(xBook);
Console.WriteLine(xSource.InnerXml);
}
}