Returns the root of the document that contains this node.
objXMLDOMDocument = oXMLDOMNode.ownerDocument
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.
The following VBScript example uses the ownerDocument property to return the parent DOMDocument object, then displays that object's root element tag name:
Dim xmlDoc Dim currNode Dim owner Set xmlDoc = CreateObject("Msxml2.DOMDocument") 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 Object | XMLDOMCDATASection Object | XMLDOMCharacterData Object | XMLDOMComment Object | DOMDocument Object | XMLDOMDocumentFragment Object | XMLDOMDocumentType Object | XMLDOMElement Object | XMLDOMEntity Object | XMLDOMEntityReference Object | XMLDOMNode Object | XMLDOMNotation Object | XMLDOMProcessingInstruction Object | XMLDOMText Object | XTLRuntime Object