CCSID conflict exception

A special case applies to exception events where the exception code in XML-CODE is in the range 100,001 through 165,535 or 200,001 through 265,535. These ranges of exception codes indicate that the CCSID of the document (determined by examining the beginning of the document, including any encoding declaration) conflicts with the CCSID for the XML PARSE statement.

In this case you can determine the CCSID of the document by subtracting 100,000 or 200,000 from the value of XML-CODE (depending on whether it is an EBCDIC CCSID or ASCII CCSID, respectively). For instance, if XML-CODE contains 101,140, the CCSID of the document is 1140.

The CCSID for your XML PARSE statement depends on the type of the XML PARSE identifier. If the identifier is a national data item, the CCSID is specified in the National CCSID compiler option or in the NTLCCSID PROCESS option, indicating Unicode. If the XML PARSE identifier is alphanumeric, the CCSID is that of the COBOL source member.

The parser takes one of three actions after returning from your processing procedure for a CCSID conflict exception event:

  • If you set XML-CODE to zero, the parser uses the CCSID for the XML PARSE statement: the CCSID specified in the National CCSID compiler option or in the NTLCCSID PROCESS option for national items; the CCSID of the COBOL source member, otherwise.
  • If you set XML-CODE to the CCSID of the document (that is, the original XML-CODE value minus 100,000 or 200,000 appropriately), the parser uses the CCSID of the document. This is the only case where the parser continues when XML-CODE has a nonzero value upon returning from your processing procedure.
  • Otherwise, the parser stops processing the document, and returns control to your XML PARSE statement with an exception condition. XML-CODE contains the exception code that was originally passed to the exception event.

The following figure illustrates these actions. The off-page connectors, such as Off-page flow-chart connector., connect the multiple charts in this chapter. In particular, P off-page connector. in the following figure connects to Control flow between XML parser and program, showing XML-CODE usage and C off-page connector. connects from Control flow for XML exceptions.

XML CCSID exception flow control

This image shows a flowchart for XML CCSID exceptions, as described in surrounding text.

related references XML exceptions that allow continuation XML exceptions that do not allow continuation Appendix F. XML reference material

XML-CODE (ILE COBOL Language Reference)