Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::ownerDocument Method

IXMLDOMNode::get_ownerDocument Method

Returns the root of the document that contains this node.

Visual Basic Syntax

Set objXMLDOMDocument = oXMLDOMNode.ownerDocument

C/C++ Syntax

HRESULT get_ownerDocument(
    IXMLDOMDocument **DOMDocument);

Parameters

DOMDocument [out]
Address of the parent document object that represents the root of the document.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if DOMDocument is Null.

Remarks

This method indicates the document to which this node belongs.

All nodes are created in the context of a document, and the ownerDocument method is maintained until the node is added to another document. For a node removed from a document, this method indicates the document in which the node was last included.

See Also

IXMLDOMNode Interface