SelectAncestors()

XPathNavigator::SelectAncestors(XPathNodeType, bool) method

Selects all the ancestor nodes of the current node that have a matching XPathNodeType.

virtual SharedPtr<XPathNodeIterator> System::Xml::XPath::XPathNavigator::SelectAncestors(XPathNodeType type, bool matchSelf)

Arguments

ParameterTypeDescription
typeXPathNodeTypeThe XPathNodeType of the ancestor nodes.
matchSelfboolTo include the context node in the selection, true; otherwise, false.

Return Value

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

XPathNavigator::SelectAncestors(String, String, bool) method

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

virtual SharedPtr<XPathNodeIterator> System::Xml::XPath::XPathNavigator::SelectAncestors(String name, String namespaceURI, bool matchSelf)

Arguments

ParameterTypeDescription
nameStringThe local name of the ancestor nodes.
namespaceURIStringThe namespace URI of the ancestor nodes.
matchSelfboolTo include the context node in the selection, true; otherwise, false.

Return Value

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

See Also