Condividi tramite


XmlComment.SelectSingleNodeNS(String, Object) Metodo

Definizione

Applica l'operazione dei criteri di ricerca specificata al contesto di questo nodo e restituisce il primo nodo corrispondente. Questo metodo non è applicabile a questa classe e genererà un'eccezione.

public:
 virtual IXmlNode ^ SelectSingleNodeNS(Platform::String ^ xpath, Platform::Object ^ namespaces) = SelectSingleNodeNS;
IXmlNode SelectSingleNodeNS(winrt::hstring const& xpath, IInspectable const& namespaces);
public IXmlNode SelectSingleNodeNS(string xpath, object namespaces);
function selectSingleNodeNS(xpath, namespaces)
Public Function SelectSingleNodeNS (xpath As String, namespaces As Object) As IXmlNode

Parametri

xpath
String

Platform::String

winrt::hstring

Specifica un'espressione XPath.

namespaces
Object

Platform::Object

IInspectable

Contiene una stringa che specifica gli spazi dei nomi da usare nelle espressioni XPath quando è necessario definire nuovi spazi dei nomi esternamente. Gli spazi dei nomi sono definiti nello stile XML, come elenco separato da spazi degli attributi di dichiarazione dello spazio dei nomi. È possibile utilizzare questa proprietà anche per impostare lo spazio dei nomi predefinito.

Restituisce

Primo nodo che corrisponde all'operazione di corrispondenza dei criteri specificata. Se nessun nodo corrisponde all'espressione, questo metodo restituisce un valore Null.

Implementazioni

M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNodeNS(System.String,System.Object) M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNodeNS(Platform::String,Platform::Object) M:Windows.Data.Xml.Dom.IXmlNodeSelector.SelectSingleNodeNS(winrt::hstring,IInspectable)

Esempio

var input = node.SelectSingleNodeNS("//*[@x:Name='Input']", "xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'");
auto input = node.SelectSingleNodeNS(L"//*[@x:Name='Input']", winrt::box_value(L"xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'"));

Si applica a