Returns the root of the document that contains this node.
Syntax
objXMLDOMDocument = oXMLDOMNode.ownerDocument
Remarks
Object. The property is read-only. It returns the parent document object that represents the root of the document to which this node belongs.
All nodes are created in the context of a document, and the ownerDocument property 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.
Example
The following example uses the ownerDocument property to return the parent XMLDOMDocument object, then displays that object's root element tag name:
Dim xmlDoc
Dim currNode
Dim owner
Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set currNode = xmlDoc.documentElement.childNodes.item(0).childNodes.item(1)
Set owner = currNode.ownerDocument
MsgBox owner.documentElement.tagName
Applies To
XMLDOMAttribute, XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMDocument, XMLDOMDocumentFragment, XMLDOMDocumentType, XMLDOMElement, XMLDOMEntity, XMLDOMEntityReference, XMLDOMNode, XMLDOMNotation, XMLDOMProcessingInstruction, XMLDOMText, XTLRuntime