For most XML events, the parser sets XML-TEXT or XML-NTEXT to an associated document fragment.
Typically, the parser sets XML-TEXT if the XML document is in an alphanumeric data item. The parser sets XML-NTEXT if:
The special registers XML-TEXT and XML-NTEXT are mutually exclusive. When the parser sets XML-TEXT, XML-NTEXT is empty with length zero. When the parser sets XML-NTEXT, XML-TEXT is empty with length zero.
To determine the number of character encoding units in XML-NTEXT, use the LENGTH intrinsic function; for example FUNCTION LENGTH(XML-NTEXT). To determine the number of bytes in XML-NTEXT, use special register LENGTH OF XML-NTEXT. The number of character encoding units differs from the number of bytes.
To determine the number of bytes in XML-TEXT, use either special register LENGTH OF XML-TEXT or the LENGTH intrinsic function; each returns the number of bytes.
The XML-TEXT and XML-NTEXT special registers are undefined outside the processing procedure.
related concepts
XML events
XML-CODE
related tasks
Writing procedures to process XML