System.Xml.XPath.XPathNavigator.SelectAncestors Method

Selects all the ancestor nodes of the current node that have the specified local name and namespace URI.

Syntax

public virtual XPathNodeIterator SelectAncestors (string name, string namespaceURI, bool matchSelf)

Parameters

name
The local name of the ancestor nodes.
namespaceURI
The namespace URI of the ancestor nodes.
matchSelf
To include the context node in the selection, true; otherwise, false.

Returns

An System.Xml.XPath.XPathNodeIterator that contains the selected nodes. The returned nodes are in reverse document order.

Remarks

If string.Empty is specified as the name parameter, all ancestor nodes that belong to the specified namespace URI are selected. If string.Empty is specified as the namespaceURI parameter, all ancestor nodes with the specified local name that belong to no namespace are selected. If string.Empty is specified as both the local name and namespace URI, all ancestor nodes that belong to no namespace are selected.

The XPathNavigator.SelectAncestors(string, string, bool) method has no effect on the state of the System.Xml.XPath.XPathNavigator.

Requirements

Namespace: System.Xml.XPath
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0