Mega Code Archive

 
Categories / VB.Net / XML
 

Loads the XML document from the specified TextReader

Imports System Imports System.IO Imports System.Xml public class Sample    public shared sub Main()      ' Create the XmlDocument.     Dim doc as XmlDocument = new XmlDocument()     Dim xmlData as string = "<book xmlns:bk='urn:samples'></book>"     doc.Load(new StringReader(xmlData))     Dim elem as XmlElement = doc.CreateElement("bk", "genre", "urn:samples")     elem.InnerText = "fantasy"     doc.DocumentElement.AppendChild(elem)     doc.Save(Console.Out)   end sub end class