XML PARSE exceptions that allow continuation

If the XMLPARSE(COMPAT) compiler option is in effect, whether the XML parser can continue processing after an exception event depends upon the value of the exception code.

The parser can continue processing if the exception code, which is in special register XML-CODE, is within one of the following ranges:

  • 1 - 99
  • 100,001 - 165,535

The following table describes each exception, and identifies the actions that the parser takes if you request that it continue after the exception. Some of the descriptions use the following terms:

  • Actual document encoding
  • Document encoding declaration

For definitions of the terms, see the related concept about XML input document encoding.

Table 1. XML PARSE exceptions that allow continuation
Exception code (decimal) Description Parser action on continuation
1 The parser found an invalid character while scanning white space outside element content.

For further information about white space, see the related concept about XML input document encoding.

The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
2 The parser found an invalid start of a processing instruction, element, comment, or document type declaration outside element content. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
3 The parser found a duplicate attribute name. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
4 The parser found the markup character '<' in an attribute value. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
5 The start and end tag names of an element did not match. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
6 The parser found an invalid character in element content. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
7 The parser found an invalid start of an element, comment, processing instruction, or CDATA section in element content. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
8 The parser found in element content the CDATA closing character sequence ']]>' without the matching opening character sequence '<![CDATA['. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
9 The parser found an invalid character in a comment. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
10 The parser found in a comment the character sequence '--' (two hyphens) not followed by '>'. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
11 The parser found an invalid character in a processing instruction data segment. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
12 The XML declaration was not at the beginning of the document. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
13 The parser found an invalid digit in a hexadecimal character reference (of the form &#xdddd;). The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
14 The parser found an invalid digit in a decimal character reference (of the form &#dddd;). The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
15 The encoding declaration value in the XML declaration did not begin with lowercase or uppercase A through Z. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
16 A character reference did not refer to a legal XML character. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
17 The parser found an invalid character in an entity reference name. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
18 The parser found an invalid character in an attribute value. The parser continues detecting errors until it reaches the end of the document or encounters an error that does not allow continuation. The parser does not signal any further normal events, except for the END-OF-DOCUMENT event.
70 The actual document encoding was EBCDIC, and the CODEPAGE compiler option specified a supported EBCDIC code page, but the document encoding declaration did not specify a supported EBCDIC code page. The parser uses the encoding specified by theCODEPAGE compiler option.
71 The actual document encoding was EBCDIC, and the document encoding declaration specified a supported EBCDIC encoding, but the CODEPAGE compiler option did not specify a supported EBCDIC code page. The parser uses the encoding specified by the document encoding declaration.
72 The actual document encoding was EBCDIC, the CODEPAGE compiler option did not specify a supported EBCDIC code page, and the document did not contain an encoding declaration. The parser uses EBCDIC code page 1140 (USA, Canada, . . . Euro Country Extended Code Page).
73 The actual document encoding was EBCDIC, but neither the CODEPAGE compiler option nor the document encoding declaration specified a supported EBCDIC code page. The parser uses EBCDIC code page 1140 (USA, Canada, . . . Euro Country Extended Code Page).
82 The actual document encoding was ASCII, but the document did not contain an encoding declaration. The parser uses ASCII code page 819 (ISO-8859-1 Latin 1/Open Systems).
83 The actual document encoding was ASCII, but the document encoding declaration did not specify code page 813, 819, or 920. The parser uses ASCII code page 819 (ISO-8859-1 Latin 1/Open Systems).
92 The document data item was alphanumeric, but the actual document encoding was Unicode UTF-16. The parser uses code page 1200 (Unicode UTF-16).
100,001 - 165,535 The CODEPAGE compiler option and the document encoding declaration specified different supported EBCDIC code pages. XML-CODE contains the code page CCSID for the encoding declaration plus 100,000. If you set XML-CODE to zero before returning from the EXCEPTION event, the parser uses the encoding specified by the CODEPAGE compiler option. If you set XML-CODE to the CCSID for the document encoding declaration (by subtracting 100,000), the parser uses this encoding.

Related concepts  
XML-CODE  
XML input document encoding
  

Related tasks  
Handling XML PARSE exceptions  

Related references  
XMLPARSE (compiler option)