XmlWriter.WriteEndElement closes one element and pops the corresponding namespace scope.
Option Explicit
Option Strict
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim settings As XmlWriterSettings = new XmlWriterSettings()
settings.Indent = true
Dim writer As XmlWriter = XmlWriter.Create(Console.Out, settings)
writer.WriteStartElement("order")
writer.WriteStartElement("item")
writer.WriteAttributeString("date", "2/19/01")
writer.WriteAttributeString("orderID", "1")
writer.WriteFullEndElement()
writer.WriteEndElement()
writer.Close()
End Sub
End Class
Related examples in the same category