XmlTextWriter.Close closes this stream and the underlying stream. : XmlTextWriter « XML « VB.Net






XmlTextWriter.Close closes this stream and the underlying stream.

 

Option Explicit
Option Strict

Imports System
Imports System.IO
Imports System.Xml

Public Class Sample

    Public Shared Sub Main()
        Dim writer As XmlTextWriter = Nothing
        writer = New XmlTextWriter(Console.Out)

        writer.Formatting = Formatting.Indented
        writer.Indentation = 4

        writer.WriteStartElement("book")

        writer.WriteStartElement("title")
        writer.WriteString("Pride And Prejudice")
        writer.WriteEndElement()

        writer.WriteEndElement()

        writer.Close()
    End Sub 
End Class 

   
  








Related examples in the same category

1.XmlTextWriter.Flush
2.XmlTextWriter.Formatting Property indicates how the output is formatted.
3.XmlTextWriter.Indentation
4.XmlTextWriter.WriteCData writes out a block
5.XmlTextWriter.WriteCharEntity Method forces the generation of a character entity for the specified Unicode character value.
6.XmlTextWriter.WriteEndElement closes one element and pops the corresponding namespace scope.
7.XmlTextWriter.WriteFullEndElement closes one element and pops the corresponding namespace scope.
8.XmlTextWriter.WriteQualifiedName Method writes out the namespace-qualified name
9.XmlTextWriter.WriteRaw Method writes raw markup manually from a string.
10.XmlTextWriter.WriteWhitespace writes out the given white space.
11.Verifies name according to the W3C Extended Markup Language recommendation.