For each event that occurs during XML parsing, the parser sets the associated event name in the XML-EVENT special register. The parser then passes the XML-EVENT special register to your processing procedure. Depending on the event, the parser passes other special registers that contain additional information about the event. In most cases, the parser sets the XML-TEXT or XML-NTEXT special register to the XML fragment that caused the event.
If the XMLPARSE(COMPAT) option is in effect, the parser sets XML-NTEXT when the XML document is in a national data item or the parser finds a Unicode character reference; otherwise, the parser sets XML-TEXT.
When the XMLPARSE(XMLSS) option is in effect, the parser sets XML-NTEXT when the RETURNING NATIONAL phrase is specified in the XML PARSE statement or when the XML document is in a national data item; otherwise, the parser sets XML-TEXT.
When the XMLPARSE(XMLSS) compiler option is in effect, the parser sets the namespace special registers for a NAMESPACE-DECLARATION event and when a name that is in a namespace is encountered.
For a detailed description of the complete set of XML events, see the related reference below for XML-EVENT.
In some cases, such as encoding conflicts, the parser provides information about the event in the XML-CODE special register.
Example: parsing a simple document
related tasks
Parsing XML documents