Редагувати

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


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);
public virtual bool MoveToChild (System.Xml.XPath.XPathNodeType type);
abstract member MoveToChild : System.Xml.XPath.XPathNodeType -> bool
override this.MoveToChild : System.Xml.XPath.XPathNodeType -> bool
Public Overridable Function MoveToChild (type As XPathNodeType) As Boolean

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

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(System::String ^ localName, System::String ^ namespaceURI);
public virtual bool MoveToChild (string localName, string namespaceURI);
abstract member MoveToChild : string * string -> bool
override this.MoveToChild : string * string -> bool
Public Overridable Function MoveToChild (localName As String, namespaceURI As String) As Boolean

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