XmlNode.NextSibling Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the node immediately following this node.

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

Public Overridable ReadOnly Property NextSibling As XmlNode

Property Value

Type: System.Xml.XmlNode

The next XmlNode. If there is no next node, null is returned.

The following example displays all the books in the XML document.

Imports System
Imports System.Xml
Imports Microsoft.VisualBasic

public class Sample 

  public shared sub Main() 

      Dim doc as XmlDocument = new XmlDocument()

      Dim currNode as XmlNode = doc.DocumentElement.FirstChild
      Console.WriteLine("First book...")

      Dim nextNode as XmlNode = currNode.NextSibling
      Console.WriteLine(ControlChars.LF + "Second book...")

  end sub
end class

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top