System.Xml.XmlReader.ReadToNextSibling Method

Advances the XmlReader to the next sibling element with the specified local name and namespace URI.

Syntax

public virtual bool ReadToNextSibling (string localName, string namespaceURI)

Parameters

localName
The local name of the sibling element you wish to move to.
namespaceURI
The namespace URI 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, 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, 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