Click to return to the XML (Extensible Markup Language) home page    
IXMLDOMDocument::doctype ...     IXMLDOMDocument::getEleme...     IXMLDOMDocument Interface    
Web Workshop  |  XML (Extensible Markup Language)

IXMLDOMDocument::get_documentElement Method


Contains the root element of the document.

Visual Basic Syntax

Set objXMLDOMElement = oXMLDOMDocument.documentElement

C/C++ Syntax

HRESULT get_documentElement(
    IXMLDOMElement **DOMElement);

Parameters

DOMElement
[out] IXMLDOMElement object that represents the single element that represents the root of the XML document tree. Returns NULL if no root exists.

C/C++ Return Values

S_OK
Value returned if successful.
S_FALSE
Value when returning null. 
E_INVALIDARG
Value returned if DOMElement is null.


IXMLDOMDocument::put_documentElement Method


Contains the root element of the document.

Visual Basic Syntax

objXMLDOMDocument.documentElement = objXMLDOMElement 

C/C++ Syntax

HRESULT put_documentElement(
    IXMLDOMElement *DOMElement);

Parameters

DOMElement
[out] IXMLDOMElement object that represents the single element that represents the root of the XML document tree. Returns NULL if no root exists.

C/C++ Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

When setting the documentElement property, the specified element node is inserted into the child list of the document after any document type node. To precisely place the node within the children of the document, call the IXMLDOMNode object's insertBefore method.

The parentNode property is reset to the document node as a result of this operation.



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.