Imports System
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book xmlns:bk='urn:samples' bk:ISBN='11111111111'><title>AAA</title></book>")
Dim root as XmlElement = doc.DocumentElement
' Add a new attribute.
Dim attr as XmlAttribute = root.SetAttributeNode("genre", "urn:samples")
attr.Value="novel"
Console.WriteLine(doc.InnerXml)
end sub
end class
|