Creates XmlWriter using the specified stream.
Imports System
Imports System.IO
Imports System.Xml
Imports System.Text
Imports Microsoft.VisualBasic
Public Class Sample
Public Shared Sub Main()
Dim writer As XmlWriter = Nothing
Try
Dim settings As XmlWriterSettings = New XmlWriterSettings()
settings.Indent = true
settings.IndentChars = (ControlChars.Tab)
settings.OmitXmlDeclaration = true
writer = XmlWriter.Create("data.xml", settings)
writer.WriteStartElement("book")
writer.WriteElementString("item", "tesing")
writer.WriteEndElement()
writer.Flush()
Finally
If Not (writer Is Nothing) Then
writer.Close()
End If
End Try
End Sub
End Class
Related examples in the same category