%XML_DOC_GETROOT

Return the root element of an XML document

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
root = %XML_DOC_GETROOT(document)

Return value

root

The XML element that is the root of the XML document. (XML_ELEM_TYPE)

Arguments

document

The XML document instance for which to return a root element. (XML_DOC_TYPE)

Discussion

If you are processing XML data from a parsed document, one of the first things you should do is find the document’s root element using %XML_DOC_GETROOT.

This function is defined as ^VAL.

Examples

root = %xml_doc_getroot(document)

For a more detailed example, see Example of parsing XML.