Writes an attribute with the specified local name, namespace URI, and value.
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim writer As XmlWriter = Nothing
writer = XmlWriter.Create("sampledata.xml")
writer.WriteStartElement("book")
writer.WriteAttributeString("xmlns","bk", Nothing,"urn:book")
writer.WriteAttributeString("ISBN", "urn:book", "1-111111-925")
writer.WriteElementString("price", "9.9")
writer.WriteEndElement()
writer.Flush()
writer.Close()
End Sub
End Class
Related examples in the same category