XPathNavigator.MoveToChild 方法

定義

XPathNavigator 移到指定的子節點。

多載

MoveToChild(XPathNodeType)

XPathNavigator 移到指定 XPathNodeType 的子節點。

MoveToChild(String, String)

XPathNavigator 移到具有指定區域名稱和命名空間 URI 的子節點。

MoveToChild(XPathNodeType)

XPathNavigator 移到指定 XPathNodeType 的子節點。

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

參數

type
XPathNodeType

要移向的子節點之 XPathNodeType

傳回

Boolean

如果 XPathNavigator 成功移至此子節點,則為 true;否則為 false。 如果為 falseXPathNavigator 的位置就不會變更。

備註

方法的 MoveToChild 傳回值取決於 XPathNodeType 目前節點的 ,以及 XPathNodeType 要移至之子節點的 。

下表顯示不同的 XPathNodeType 節點,以及其可移至的子節點。

目前節點的 XPathNodeType 子節點的 XPathNodeType
Root ElementProcessingInstructionCommentText
Element ElementProcessingInstructionCommentText
所有其他 XPathNodeType 無。

適用於

MoveToChild(String, String)

XPathNavigator 移到具有指定區域名稱和命名空間 URI 的子節點。

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

參數

localName
String

要移向的子節點之區域名稱。

namespaceURI
String

要移向的子節點之命名空間 URI。

傳回

Boolean

如果 XPathNavigator 成功移至此子節點,則為 true;否則為 false。 如果為 falseXPathNavigator 的位置就不會變更。

範例

如需 方法的 MoveToChild 範例,請參閱 AppendChild 方法。

適用於