System::Xml::XmlNode::SelectSingleNode 方法

XmlNode::SelectSingleNode(const String&) method

选择匹配 XPath 表达式的第一个 XmlNode

SharedPtr<XmlNode> System::Xml::XmlNode::SelectSingleNode(const String &xpath)
参数类型描述
xpathconst String&XPath 表达式。

ReturnValue

匹配 XPath 查询的第一个 XmlNode,如果未找到匹配的节点则返回 nullptr

另见

XmlNode::SelectSingleNode(const String&, const SharedPtr<XmlNamespaceManager>&) method

选择匹配 XPath 表达式的第一个 XmlNode。在 XPath 表达式中发现的任何前缀均使用提供的 XmlNamespaceManager 进行解析。

SharedPtr<XmlNode> System::Xml::XmlNode::SelectSingleNode(const String &xpath, const SharedPtr<XmlNamespaceManager> &nsmgr)
参数类型描述
xpathconst String&XPath 表达式。
nsmgrconst SharedPtr<XmlNamespaceManager>&用于在 XPath 表达式中解析前缀命名空间的 XmlNamespaceManager

ReturnValue

匹配 XPath 查询的第一个 XmlNode,如果未找到匹配的节点则返回 nullptr

另见