Documentation Center

getDocumentElement

Description

Get the root element of this document.

The root node of the XML document is much like any other element. The document Element can be found easily through the use of another function: getOwnerDocument. If you first pass another node to your JavaScript, you can then use this to get the document's root element:

<xsl:template match="anynode">
  <div onclick="UpdateDocumentElement(node)">
    <xsl:apply-templates/> 
  </div> 
</template>
function UpdateDocumentElement(xopusElement)
{
  var documentElement = xopusElement.getOwnerDocument().getDocumentElement();
  documementElement.setAttribute("dateModified",new Date().getTime());
}

Syntax

XopusDocument.getDocumentElement () : XopusElement

Return Value

XopusElement. The document element.