Partager via


context Property (Compact 2013)

3/26/2014

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

Syntax

var objXMLDOMNode = objXMLDOMSelection.context;
objXMLDOMSelection.context = objXMLDOMNode;
HRESULT get_context(
  IXMLDOMNode** ppNode
);
HRESULT putref_context(
  IXMLDOMNode* pNode
);

Parameters

None.

C/C++

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

Return Value

Script

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

C/C++

  • 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.

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.

Requirements

Header

msxml2.h,
msxml2.idl

See Also

Reference

XML DOM Properties