XmlDocument.SelectSingleNode(String) 方法

定義

將指定的模式比對作業套用至這個節點的內容,並傳回第一個相符的節點。

public:
 virtual IXmlNode ^ SelectSingleNode(Platform::String ^ xpath) = SelectSingleNode;
IXmlNode SelectSingleNode(winrt::hstring const& xpath);
public IXmlNode SelectSingleNode(string xpath);
function selectSingleNode(xpath)
Public Function SelectSingleNode (xpath As String) As IXmlNode

參數

xpath
String

Platform::String

winrt::hstring

指定 XPath 運算式。

傳回

符合指定模式比對作業的第一個節點。 如果沒有節點符合運算式,方法會傳回 Null 值。

實作

M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNode(System.String) M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNode(Platform::String) M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNode(winrt::hstring)

備註

如需示範如何使用此方法的範例,請參閱XML DOM 範例 (Windows 10)

適用於