XPathNavigator.IsDescendant(XPathNavigator) 方法

定義

判斷指定的 XPathNavigator 是否為目前 XPathNavigator 的子代 (Descendant)。

public:
 virtual bool IsDescendant(System::Xml::XPath::XPathNavigator ^ nav);
public virtual bool IsDescendant (System.Xml.XPath.XPathNavigator? nav);
public virtual bool IsDescendant (System.Xml.XPath.XPathNavigator nav);
abstract member IsDescendant : System.Xml.XPath.XPathNavigator -> bool
override this.IsDescendant : System.Xml.XPath.XPathNavigator -> bool
Public Overridable Function IsDescendant (nav As XPathNavigator) As Boolean

參數

nav
XPathNavigator

要和此 XPathNavigator 比較的 XPathNavigator

傳回

如果指定的 XPathNavigator 是目前 XPathNavigator 的子代,則為 true,否則為 false

備註

XPathNavigator如果位於目前 的子系節點上,則 為目前 XPathNavigatorXPathNavigator 的子系。 例如,採用下列 XML 字串:

<item><name>widget</name></item>

如果目前的 XPathNavigator 位於 item 節點上,而且 XPathNavigator 指定的 位於 name 節點上, IsDescendant 則會傳 true 回 。

此方法一律會在下列情況下傳 false 回:

  • 指定的 XPathNavigator 共用相同的實作,但指向與目前導覽器不同的檔實例。

  • 指定的 XPathNavigator 具有與目前導覽器不同的實作。

適用於