Share via


selectSingleNode Method (Windows CE 5.0)

Send Feedback

Applies the specified pattern-matching operation to this node's context and returns the first matching node.

[Script]

Script Syntax

varobjXMLDOMNode = oXMLDOMNode.selectSingleNode(queryString);

Script Parameters

  • queryString
    String specifying the Extensible Stylesheet Language (XSL) or XPath query that is to be applied to the context defined by this node. The value of the SelectionLanguage internal property (flag) determines whether an XSL or XPath query is used. By default, the expression is an XSL pattern query. The SelectionLanguage internal property (flag) can be set with the setProperty methodxmmthsetProperty.

Script Return Value

Object. Returns the first node that matches the XSL or XPath query. If no nodes match the query, it returns Null.

[C/C++]

C/C++ Syntax

HRESULT selectSingleNode(BSTRqueryString,IXMLDOMNode** resultNode);

C/C++ Parameters

  • queryString
    [in] String specifying the XSL or XPath query that is to be applied to the context defined by this node. The value of the SelectionLanguage internal property (flag) determines whether an XSL or XPath query is used. By default, the expression is an XSL pattern query. The SelectionLanguage internal property (flag) can be set with the setProperty method.
  • resultNode
    [out, retval] First node that is selected by the XPath query. If no nodes result from the query, it returns Null.

C/C++ Return Values

  • S_OK
    Value returned if successful.
  • S_FALSE
    Value returned if there is no match.
  • E_INVALIDARG
    Value returned if resultNode is Null.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.

General Remarks

This method is only valid if the XML Query Language (XQL) feature has been included in the OS. If a call to this method is made and XQL is not supported, an error message will be returned.

The selectSingleNode method is similar to the selectNodes method, but returns only the first matching node rather than the list of all matching nodes.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

This method applies to the following objects and interfaces:

IXMLDOMAttribute, IXMLDOMCDATASection, IXMLDOMCharacterData, IXMLDOMComment, DOMDocument, IXMLDOMDocumentFragment, IXMLDOMDocumentType, IXMLDOMElement, IXMLDOMEntity, IXMLDOMEntityReference, IXMLDOMNode, IXMLDOMNotation, IXMLDOMProcessingInstruction, IXMLDOMText, and IXTLRuntime.

See Also

selectNodes Method

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.