Прочетете на английски Редактиране

Споделяне чрез


XPathNavigator.SelectChildren Method

Definition

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

Overloads

SelectChildren(XPathNodeType)

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

SelectChildren(String, String)

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

SelectChildren(XPathNodeType)

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

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

C#
public virtual System.Xml.XPath.XPathNodeIterator SelectChildren(System.Xml.XPath.XPathNodeType type);

Parameters

type
XPathNodeType

The XPathNodeType of the child nodes.

Returns

An XPathNodeIterator that contains the selected nodes.

Examples

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

Remarks

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

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

SelectChildren(String, String)

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

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

C#
public virtual System.Xml.XPath.XPathNodeIterator SelectChildren(string name, string namespaceURI);

Parameters

name
String

The local name of the child nodes.

namespaceURI
String

The namespace URI of the child nodes.

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 child nodes that belong to the specified namespace URI are selected. If String.Empty is specified as the namespaceURI parameter, all child 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 child nodes that belong to no namespace are selected.

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

See also

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1