Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Handling conflicts in code pages

The way that you handle encoding conflict exceptions depends on the setting of the XMLPARSE compiler option.

For XMLPARSE(XMLSS)

When the XMLPARSE(XMLSS) compiler option is in effect, the parser does not continue for an encoding conflict or for any other type of exception. Any changes that you make to the value of XML-CODE are ignored. The value in XML-CODE when the parser returns to the XML PARSE statement is the original exception code.

Tip: When an encoding conflict exception occurs, the z/OS XML System Services reason code is usually XRSN_PARM_ENCODING_SPEC_INVALID. However, you might get a different reason code (such as one that indicates a bad character) if the conflict is detected after parsing begins.

For XMLPARSE(COMPAT)

When the XMLPARSE(COMPAT) compiler option is in effect, your processing procedure might be able to handle exceptions for document encoding conflicts. Exception events in which the document item is alphanumeric and the exception code in XML-CODE is between 100,001 and 165,535 indicate that the code page of the document (as specified by its encoding declaration) conflicts with the external code-page information.

In this special case, you can choose to parse with the code page of the document by subtracting 100,000 from the value in XML-CODE. For instance, if XML-CODE contains 101,140, the code page of the document is 1140. Alternatively, you can choose to parse with the external code page by setting XML-CODE to zero before returning to the parser.

The parser takes one of three actions after returning from a processing procedure for a code-page conflict exception event:

related concepts    
XML-CODE    
How the XML parser handles errors  


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)