次の方法で共有


selectSingleNode Method (Windows Embedded CE 6.0)

1/6/2010

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

Script Syntax

var objXMLDOMNode = oXMLDOMNode.selectSingleNode(queryString);

Remarks

Ee502077.collapse(en-US,WinEmbedded.60).gifScript 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.

Ee502077.collapse(en-US,WinEmbedded.60).gifScript Return Value

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

Ee502077.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

HRESULT selectSingleNode(
  BSTR queryString,
  IXMLDOMNode** resultNode
);

Remarks

Ee502077.collapse(en-US,WinEmbedded.60).gifC/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.

Ee502077.collapse(en-US,WinEmbedded.60).gifC/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.

Ee502077.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

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

Reference

XML DOM Methods

Concepts

selectNodes Method