XmlTextReader.GetRemainder gets the remainder of the buffered XML. : XmlTextReader « XML « VB.Net






XmlTextReader.GetRemainder gets the remainder of the buffered XML.

 

Imports System
Imports System.Xml

Public Class Sample
    Private Shared filename As String = "tworeads.xml"
    Public Shared Sub Main()
        Dim reader As New XmlTextReader(filename)
        reader.WhitespaceHandling = WhitespaceHandling.None

        While reader.Read()
            Select Case reader.NodeType
                Case XmlNodeType.Element
                    Console.WriteLine("Name: {0}", reader.Name)
                Case XmlNodeType.Text
                    Console.WriteLine("  Element Text: {0}", reader.Value)
                Case XmlNodeType.EndElement
                    If "book" = reader.LocalName Then
                        Console.WriteLine("End reading first book...")
                    End If
            End Select
        End While
        reader.Close()
    End Sub 'Main
End Class 'Sample

   
  








Related examples in the same category

1.Create XmlTextReader class with the specified file.
2.Create XmlTextReader class with the specified TextReader.
3.XmlTextReader.AttributeCount gets the number of attributes on the current node.
4.XmlTextReader.BaseURI Property gets the base URI of the current node.
5.XmlTextReader.Depth Property gets the depth of the current node in the XML document.
6.XmlTextReader.GetAttribute gets the value of the attribute with the specified name.
7.XmlTextReader.HasValue tells whether the current node can have a Value other than String.Empty.
8.XmlTextReader.IsEmptyElement tells whether the current node is an empty element (for example, ).
9.XmlTextReader.LinePosition Property gets the current line position.
10.XmlTextReader.LocalName Property gets the local name of the current node.
11.XmlTextReader.MoveToFirstAttribute Method moves to the first attribute.
12.XmlTextReader.Name Property gets the qualified name of the current node.
13.XmlTextReader.Normalization Property tells whether to normalize white space and attribute values.
14.XmlTextReader.ReadBase64 Method decodes Base64 and returns the decoded binary bytes.
15.XmlTextReader.XmlLang Property gets the current xml:lang scope.
16.XmlTextReader.XmlSpace Property gets the current xml:space scope.
17.Read binary hex value