Progress
Language Reference


GET-DOCUMENT-ELEMENT( ) Method

Retrieves the root element of the document. The parameter must be a valid X-NODEREF handle and will refer to the document’s root element if the method succeeds.

Return Type: LOGICAL

Applies To: X-document Object Handle

SYNTAX
GET-DOCUMENT-ELEMENT( x-node-handle ) 

x-node-handle

A valid X-NODEREF handle to use for the root element.

The following example demonstrates the use of GET-DOCUMENT-ELEMENT if hDoc is an X-DOCUMENT and hRoot is an X-NODEREF:

/* Creates a 4GL document object & initializes the associated XML object. */
CREATE X-DOCUMENT hDoc.

/* Creates a 4GL reference for an XML node in a parse tree. */
CREATE X-NODEREF hRoot.

/* Reads the myxml.xml document into an XML parse tree. */
hDoc:LOAD("file","myxml.xml",false).

/* Associates hRoot with the root node of the hDoc document. */
hDoc:GET-DOCUMENT-ELEMENT(hRoot). 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095