System.Xml.XmlReader.ReadToNextSibling Method

Advances the XmlReader to the next sibling element with the specified qualified name.

Syntax

public virtual bool ReadToNextSibling (string name)

Parameters

name
The qualified name of the sibling element you wish to move to.

Returns

true if a matching sibling element is found; otherwise false. If a matching sibling element is not found, the XmlReader is positioned on the end tag (XmlReader.NodeType is XmlNodeType.EndElement) of the parent element.

Remarks

Note:

Do not call XmlReader.ReadToNextSibling(string) when the XmlReader is an initial state (XmlReader.ReadState is ReadState.Initial). You can call XmlReader.Read to advance the XmlReader and then call the XmlReader.ReadToNextSibling(string) method.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0