XML-EVENT Special Register

The XML-EVENT special register is used to communicate event information from the XML parser to the processing procedure that was identified in the XML PARSE statement. Prior to passing control to the processing procedure, the XML parser sets the XML-EVENT special register to the name of the XML event, as described in Table 1.

The XML-CODE special register has the implicit definition:

01 XML-EVENT USAGE DISPLAY PICTURE X(30) VALUE SPACE.

When used in nested programs, this special register is implicitly defined with the global attribute in the outermost program.

XML-EVENT cannot be used as a receiving data item.

Table 1. Contents of XML-EVENT and XML-TEXT or XML-NTEXT special registers
XML event (content of XML-EVENT) Content of XML-TEXT or XML-NTEXT
ATTRIBUTE-CHARACTER The single character corresponding with the predefined entity reference in the attribute value.
ATTRIBUTE-CHARACTERS The value within quotes or apostrophes. This can be a substring of the attribute value if the value includes an entity reference.
ATTRIBUTE-NAME The attribute name, the string to the left of =.
ATTRIBUTE-NATIONAL-CHARACTER Regardless of the type of the XML document specified by identifier-1 in the XML PARSE statement, XML-TEXT is empty and XML-NTEXT contains the single national character corresponding with the (numeric) character reference.
COMMENT The text of the comment between the opening character sequence "<!—" and the closing character sequence "—>".
CONTENT-CHARACTER The single character corresponding with the predefined entity reference in the element content.
CONTENT-CHARACTERS The element content between start and end tags. This can be a sub-string of the element content if the content contains an entity reference or another element.
CONTENT-NATIONAL-CHARACTER Regardless of the type of the XML document specified by identifier-1 in the XML PARSE statement, XML-TEXT is empty and XML-NTEXT contains the single national character corresponding with the (numeric) character reference.
DOCUMENT-TYPE-DECLARATION The entire document type declaration including the opening and closing character sequences, "<!DOCTYPE" and ">".
ENCODING-DECLARATION The value, between quotes or apostrophes, of the encoding declaration in the XML declaration.
END-OF-CDATA-SECTION Always contains the string "]]>".
END-OF-DOCUMENT Null, zero-length.
END-OF-ELEMENT The name of the end element tag or empty element tag.
EXCEPTION The part of the document successfully scanned, up to and including the point at which the exception was detected. 1
PROCESSING-INSTRUCTION-DATA The rest of the processing instruction, not including the closing sequence, "?>", but including trailing, and not leading, white space characters.
PROCESSING-INSTRUCTION-TARGET The processing instruction target name, which occurs immediately after the processing instruction opening sequence, "<?".
STANDALONE-DECLARATION The value, between quotes or apostrophes, of the standalone declaration in the XML declaration.
START-OF-CDATA-SECTION Always contains the string "<![CDATA[".
START-OF-DOCUMENT The entire document.
START-OF-ELEMENT The name of the start element tag or empty element tag, also known as the element type.
UNKNOWN-REFERENCE-IN-CONTENT The entity reference name, not including the "&" and ";" delimiters.
UNKNOWN-REFERENCE-IN-ATTRIBUTE The entity reference name, not including the "&" and ";" delimiters.
VERSION-INFORMATION The value, between quotes or apostrophes, of the version declaration in the XML declaration. This is currently always "1.0".
Note:
  1. Exceptions for encoding conflicts are signaled before parsing begins. For these exceptions, XML-TEXT is either zero-length or contains just the encoding declaration value from the document. See the ILE COBOL Programmer's Guide for information on XML exception codes.