Share via


documentElement Property

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Contains the root element of the document.

Script Syntax

var objXMLDOMElement = oXMLDOMDocument.documentElement;
objXMLDOMDocument.documentElement = objXMLDOMElement;

Remarks

Script Parameters

None.

Script Return Value

Object. It returns IXMLDOMElement that represents the single element that represents the root of the XML document tree. It returns Null if no root exists.

C/C++ Syntax

HRESULT get_documentElement(
  IXMLDOMElement** DOMElement
);
HRESULT putref_documentElement(
  IXMLDOMElement* DOMElement
);

Remarks

C/C++ Parameters

  • DOMElement
    [out, retval][in] IXMLDOMElement object that represents the single element representing 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 (for get_documentElement only)
    Value returned if there is no document element.
  • E_INVALIDARG (for get_documentElement only)
    Value returned if DOMElement is Null.

Requirements

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

General 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 IXMLDOMNode insertBefore Method.

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

The property is read/write, and applies to the following objects and interfaces:

DOMDocument, IXMLDOMElement, and IXMLDOMNode.

See Also

Concepts

parentNode Property

Other Resources