%XML_ELEM_GETTEXT

Get the text value of an XML element

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
status = %XML_ELEM_GETTEXT(element, text[, length])

Return value

status

XML_SUCCESS if a nonblank text value is returned.

Arguments

element

The XML element instance to get a value for. (XML_ELEM_TYPE)

text

Returned with the text string value of the element. The maximum length is 65,534 characters. (a)

length

(optional) Returned with the length of the returned text. (n)

Discussion

%XML_ELEM_GETTEXT returns the text that appears between the specified element’s opening tag and closing tag, including any embedded XML documents delimited by CDATA. To control whether text or attribute values are escaped or unescaped, use the ENCODE option of %XML_OPTION. To control whether leading and trailing blanks are stripped in the text element, use the PARSER option of %XML_OPTION. (See %XML_OPTION.)

This function is defined as ^VAL.

Note

If you want to receive variable-length data in a large buffer, we recommend using the length argument, as this will avoid time spent clearing the remainder of the buffer (beyond length) with spaces.