Freigeben über


documentElement Property (Compact 2013)

3/26/2014

Contains the root element of the document.

Syntax

var objXMLDOMElement = oXMLDOMDocument.documentElement;
objXMLDOMDocument.documentElement = objXMLDOMElement;
HRESULT get_documentElement(IXMLDOMElement** DOMElement);
HRESULT putref_documentElement(IXMLDOMElement* DOMElement);

Parameters

Script

None.

C/C++

  • 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.

Return Value

Script

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++

  • 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.

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.

Requirements

Header

msxml2.h,
msxml2.idl

See Also

Reference

XML DOM Properties
parentNode Property