XPathNavigator.MoveToChild Method

Definition

Moves the XPathNavigator to the child node specified.

Overloads

MoveToChild(XPathNodeType)

Moves the XPathNavigator to the child node of the XPathNodeType specified.

MoveToChild(String, String)

Moves the XPathNavigator to the child node with the local name and namespace URI specified.

MoveToChild(XPathNodeType)

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

Moves the XPathNavigator to the child node of the XPathNodeType specified.

public virtual bool MoveToChild (System.Xml.XPath.XPathNodeType type);

Parameters

type
XPathNodeType

The XPathNodeType of the child node to move to.

Returns

true if the XPathNavigator is successful moving to the child node; otherwise, false. If false, the position of the XPathNavigator is unchanged.

Remarks

The return value of the MoveToChild method depends on the XPathNodeType of the current node, and the XPathNodeType of the child node to move to.

The following table shows the different XPathNodeType nodes, and the child nodes they can move to.

Current Node's XPathNodeType Child Node's XPathNodeType
Root Element, ProcessingInstruction, Comment, or Text.
Element Element, ProcessingInstruction, Comment, or Text.
All other XPathNodeType values None.

Applies to

.NET 9 e outras versões
Produto Versões
.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
.NET Framework 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

MoveToChild(String, String)

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

Moves the XPathNavigator to the child node with the local name and namespace URI specified.

public virtual bool MoveToChild (string localName, string namespaceURI);

Parameters

localName
String

The local name of the child node to move to.

namespaceURI
String

The namespace URI of the child node to move to.

Returns

true if the XPathNavigator is successful moving to the child node; otherwise, false. If false, the position of the XPathNavigator is unchanged.

Examples

For an example of the MoveToChild method, see the AppendChild method.

Applies to

.NET 9 e outras versões
Produto Versões
.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
.NET Framework 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