Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


XML-EVENT

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 Contents of XML-EVENT and XML-TEXT or XML-NTEXT special registers (Table 3).

XML-EVENT 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 3. 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 substring 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.1
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.2
Special register XML-CODE contains the unique error code identifying the exception.
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 stand-alone 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'.
  1. National characters with scalar values greater than 65,535 (NX“FFFF”) are represented using two encoding units (a “surrogate pair”). Programmers are responsible for ensuring that operations on the content of XML-NTEXT do not split the pair of encoding units that together form a graphic character, thereby forming invalid data.
  2. 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 COBOL for Windows Programming Guide for information about XML exception codes.

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)