语言

XPathNavigator.IsDescendant(XPathNavigator) 方法

定义

确定指定 XPathNavigator 是否为当前 XPathNavigator后代。

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当前XPathNavigatorXPathNavigator子代的后代。 例如,采用以下 XML 字符串:

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

如果当前 XPathNavigator 位置在 item 节点上,并且 XPathNavigator 指定的位置在 name 节点上, IsDescendant 则返回 true。

此方法始终在以下条件下返回 false :

  • 指定的 XPathNavigator 实现共享相同的实现,但指向与当前导航器不同的文档实例。

  • 指定的 XPathNavigator 实现与当前导航器不同。

适用于