XmlDocumentXPathExtensions.SelectSingleNode 方法

定义

重载

SelectSingleNode(XmlNode, String)

选择与 XPath 表达式匹配的第一个节点。Selects the first node that matches the XPath expression.

SelectSingleNode(XmlNode, String, XmlNamespaceManager)

选择与 XPath 表达式匹配的第一个节点。Selects the first node that matches the XPath expression. 使用提供的命名空间管理器解析 XPath 表达式中的任何前缀。Any prefixes found in the XPath expression are resolved using the supplied namespace manager.

SelectSingleNode(XmlNode, String)

选择与 XPath 表达式匹配的第一个节点。Selects the first node that matches the XPath expression.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Xml::XmlNode ^ SelectSingleNode(System::Xml::XmlNode ^ node, System::String ^ xpath);
public static System.Xml.XmlNode SelectSingleNode (this System.Xml.XmlNode node, string xpath);
static member SelectSingleNode : System.Xml.XmlNode * string -> System.Xml.XmlNode
<Extension()>
Public Function SelectSingleNode (node As XmlNode, xpath As String) As XmlNode

参数

node
XmlNode

导航器最初定位到的节点。The node where the navigator is initially positioned.

xpath
String

要匹配的 XPath 表达式。The XPath expression to match.

返回

XmlNode

与 XPath 查询匹配的第一个节点; null 如果未找到匹配的节点,则为。The first node that matches the XPath query, or null if no matching node is found.

另请参阅

适用于

SelectSingleNode(XmlNode, String, XmlNamespaceManager)

选择与 XPath 表达式匹配的第一个节点。Selects the first node that matches the XPath expression. 使用提供的命名空间管理器解析 XPath 表达式中的任何前缀。Any prefixes found in the XPath expression are resolved using the supplied namespace manager.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Xml::XmlNode ^ SelectSingleNode(System::Xml::XmlNode ^ node, System::String ^ xpath, System::Xml::XmlNamespaceManager ^ nsmgr);
public static System.Xml.XmlNode SelectSingleNode (this System.Xml.XmlNode node, string xpath, System.Xml.XmlNamespaceManager nsmgr);
static member SelectSingleNode : System.Xml.XmlNode * string * System.Xml.XmlNamespaceManager -> System.Xml.XmlNode
<Extension()>
Public Function SelectSingleNode (node As XmlNode, xpath As String, nsmgr As XmlNamespaceManager) As XmlNode

参数

node
XmlNode

导航器最初定位到的节点。The node where the navigator is initially positioned.

xpath
String

要匹配的 XPath 表达式。The XPath expression to match.

nsmgr
XmlNamespaceManager

用于解析 XPath 表达式前缀命名空间的命名空间管理器。A namespace manager to resolve XPath expression prefix namespaces.

返回

XmlNode

与 XPath 查询匹配的第一个节点; null 如果未找到匹配的节点,则为。The first node that matches the XPath query, or null if no matching node is found.

另请参阅

适用于