PROPERTY:  Node::ownerDocument

Node.ownerDocument

The ownerDocument property returns the Document object to which the node belongs. If the node itself is a document, then it returns null.

To illustrate this, the following example gets the parent document of the root node of the 'states.xml' file, and displays its nodeName.

Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("states.xml")

Dim objNode
Set objNode = objXMLDoc.documentElement.ownerDocument
document.write(objNode.nodeName)

Output:
#document



Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information