%XML_DOC_SETROOT

Set the root element of an XML document

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %XML_DOC_SETROOT(document, element)

Return value

status

XML_SUCCESS if the root element is set successfully.

Arguments

document

The XML document instance for which to set the root element. (XML_DOC_TYPE)

element

The XML element instance to set as the root. (XML_ELEM_TYPE)

Discussion

An XML document should contain only one root element, and that element may appear only once in the document. The remainder of the page contents are contained inside this element.

Note that %XML_DOC_CREATE automatically creates a root element when it creates a new XML document.

This function is defined as ^VAL.

Examples

xcall xml_doc_setRoot(document, root)

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