Редагувати

Поділитися через


XPathNavigator.SelectDescendants Method

Definition

Selects all the descendant nodes of the current node that match the selection criteria.

Overloads

SelectDescendants(XPathNodeType, Boolean)

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

SelectDescendants(String, String, Boolean)

Selects all the descendant nodes of the current node with the local name and namespace URI specified.

SelectDescendants(XPathNodeType, Boolean)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

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

public:
 virtual System::Xml::XPath::XPathNodeIterator ^ SelectDescendants(System::Xml::XPath::XPathNodeType type, bool matchSelf);
public virtual System.Xml.XPath.XPathNodeIterator SelectDescendants (System.Xml.XPath.XPathNodeType type, bool matchSelf);
abstract member SelectDescendants : System.Xml.XPath.XPathNodeType * bool -> System.Xml.XPath.XPathNodeIterator
override this.SelectDescendants : System.Xml.XPath.XPathNodeType * bool -> System.Xml.XPath.XPathNodeIterator
Public Overridable Function SelectDescendants (type As XPathNodeType, matchSelf As Boolean) As XPathNodeIterator

Parameters

type
XPathNodeType

The XPathNodeType of the descendant nodes.

matchSelf
Boolean

true to include the context node in the selection; otherwise, false.

Returns

An XPathNodeIterator that contains the selected nodes.

Examples

For an example of selecting ancestor, child and descendant nodes, see SelectAncestors.

Remarks

The SelectDescendants method has no effect on the state of the XPathNavigator.

See also

Applies to

SelectDescendants(String, String, Boolean)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

Selects all the descendant nodes of the current node with the local name and namespace URI specified.

public:
 virtual System::Xml::XPath::XPathNodeIterator ^ SelectDescendants(System::String ^ name, System::String ^ namespaceURI, bool matchSelf);
public virtual System.Xml.XPath.XPathNodeIterator SelectDescendants (string name, string namespaceURI, bool matchSelf);
abstract member SelectDescendants : string * string * bool -> System.Xml.XPath.XPathNodeIterator
override this.SelectDescendants : string * string * bool -> System.Xml.XPath.XPathNodeIterator
Public Overridable Function SelectDescendants (name As String, namespaceURI As String, matchSelf As Boolean) As XPathNodeIterator

Parameters

name
String

The local name of the descendant nodes.

namespaceURI
String

The namespace URI of the descendant nodes.

matchSelf
Boolean

true to include the context node in the selection; otherwise, false.

Returns

An XPathNodeIterator that contains the selected nodes.

Exceptions

null cannot be passed as a parameter.

Examples

For an example of selecting ancestor, child, and descendant nodes, see SelectAncestors.

Remarks

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

A descendant is a child or a child of a child and so on; thus the selected nodes will never contain attribute or namespace nodes.

The SelectDescendants method has no effect on the state of the XPathNavigator.

See also

Applies to