XmlReader.ReadToFollowing Method (String)

Reads until an element with the specified qualified name is found.

Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)

Public Overridable Function ReadToFollowing ( _
	name As String _
) As Boolean
Dim instance As XmlReader
Dim name As String
Dim returnValue As Boolean

returnValue = instance.ReadToFollowing(name)
public boolean ReadToFollowing (
	String name
public function ReadToFollowing (
	name : String
) : boolean
Not applicable.



The qualified name of the element.

Return Value

true if a matching element is found; otherwise false and the XmlReader is in an end of file state.

This method is functionally equivalent executing the following::name XPath expression from the current node. It provides a quick way to find a named element in the XML document. It advances the reader to the next following element that matches the specified name and returns true if a matching element is found.

This method can be called on all node types.

The following example reads the ISBN attribute on each book node.

Using reader As XmlReader = XmlReader.Create("books.xml")
    Console.WriteLine("ISBN: {0}", reader.GetAttribute("ISBN"))
  Loop While reader.ReadToNextSibling("book")
End Using

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions