System::Xml::XPath::XPathNavigator::SelectSingleNode 方法

XPathNavigator::SelectSingleNode(SharedPtr<XPathExpression>) method

使用指定的 XPathExpression 对象在 XPathNavigator 中选择单个节点。

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(SharedPtr<XPathExpression> expression)
参数类型描述
expressionSharedPtr<XPathExpression>一个包含已编译的 XPath 查询的 XPathExpression 对象。

ReturnValue

一个 XPathNavigator 对象,包含指定的 XPath 查询的第一个匹配节点;如果没有查询结果,则为 nullptr

另见

XPathNavigator::SelectSingleNode(String) method

使用指定的 XPath 查询在 XPathNavigator 中选择单个节点。

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(String xpath)
参数类型描述
xpathString一个表示 XPath 表达式的 String

ReturnValue

一个 XPathNavigator 对象,包含指定的 XPath 查询的第一个匹配节点;如果没有查询结果,则为 nullptr

另见

XPathNavigator::SelectSingleNode(String, SharedPtr<IXmlNamespaceResolver>) method

使用指定的 IXmlNamespaceResolver 对象解析命名空间前缀,使用指定的 XPath 查询在 XPathNavigator 对象中选择单个节点。

virtual SharedPtr<XPathNavigator> System::Xml::XPath::XPathNavigator::SelectSingleNode(String xpath, SharedPtr<IXmlNamespaceResolver> resolver)
参数类型描述
xpathString一个表示 XPath 表达式的 String
resolverSharedPtr<IXmlNamespaceResolver>用于在 XPath 查询中解析命名空间前缀的 IXmlNamespaceResolver 对象。

ReturnValue

一个 XPathNavigator 对象,包含指定的 XPath 查询的第一个匹配节点;如果没有查询结果,则为 nullptr

另见