Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Returns the root of the document that contains the node.

Script Syntax

Copy Code
var objXMLDOMDocument = oXMLDOMNode.ownerDocument;

Remarks

Script Parameters

None.

Script Return Value

Object. Returns the parent document that represents the root of the document with this node.

C/C++ Syntax

Copy Code
HRESULT get_ownerDocument(
  IXMLDOMDocument** 
DOMDocument
);

Remarks

C/C++ Parameters

DOMDocument

[out, retval] 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 DOMDocumentis Null.

Requirements

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

General Remarks

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

This property is read-only, and applies to the following objects and interfaces:

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