Compartilhar via


context Property

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Gets the node (subtree) that is applied to the selection.

Script Syntax

var objXMLDOMNode = objXMLDOMSelection.context;
objXMLDOMSelection.context = objXMLDOMNode;

Remarks

Script Parameters

None.

Script Return Value

Object. Returns the subtree that is applied to the selection.

C/C++ Syntax

HRESULT get_context(
  IXMLDOMNode** ppNode
);
HRESULT putref_context(
  IXMLDOMNode* pNode
);

Remarks

C/C++ Parameters

  • ppNode
    [out, retval] The subtree to apply the pattern to.
  • pNode
    [in] The subtree to apply the pattern to.

C/C++ Return Values

  • S_OK
    Value returned if the method is successful.
  • S_FALSE (for get_context only)
    Value returned if the context is invalid.
  • E_INVALIDARG (for get_context only)
    Value returned if the input argument is Null.
  • E_FAIL (for putref_context only)
    Value returned if a node with a different threading model is provided.

Requirements

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

General Remarks

Because the selectNodes method can be called on any node type, context can also be assigned any node type. A node from a different document from the one that originally created IXMLDOMSelection can also be specified as long as it has the same threading model. Calling context also resets the state of the node list so that nextNode starts over.

This property applies to the following interface:

IXMLDOMSelection.