Mega Code Archive

 
Categories / VB.Net / XML
 

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