XmlDocumentXPathExtensions.SelectSingleNode 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| SelectSingleNode(XmlNode, String) |
選擇第一個與 XPath 表達式相符的節點。 |
| SelectSingleNode(XmlNode, String, XmlNamespaceManager) |
選擇第一個與 XPath 表達式相符的節點。 XPath 表達式中發現的任何前綴,皆可透過提供的命名空間管理器解析。 |
SelectSingleNode(XmlNode, String)
選擇第一個與 XPath 表達式相符的節點。
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
導航員最初所在的節點。
- xpath
- String
XPath 的表情也相呼應。
傳回
第一個與 XPath 查詢相符的節點,或 null 若找不到匹配節點,則為該節點。
適用於
SelectSingleNode(XmlNode, String, XmlNamespaceManager)
選擇第一個與 XPath 表達式相符的節點。 XPath 表達式中發現的任何前綴,皆可透過提供的命名空間管理器解析。
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
導航員最初所在的節點。
- xpath
- String
XPath 的表情也相呼應。
- nsmgr
- XmlNamespaceManager
一個用來解析 XPath 表達式前綴命名空間的命名空間管理器。
傳回
第一個與 XPath 查詢相符的節點,或 null 若找不到匹配節點,則為該節點。