When the XML parser detects an error in an XML document, it generates an XML exception event and passes control to your processing procedure.
The parser provides the following information in special registers:
For XMLPARSE(XMLSS), the exception codes are described in the related reference below for z/OS XML System Services. For XMLPARSE(COMPAT), the exception codes are described in the related references below for XML PARSE exceptions.
All other XML special registers are empty with length zero.
For XMLPARSE(XMLSS)
When XMLPARSE(XMLSS) is in effect, you cannot continue parsing after an exception, even if you set XML-CODE to zero before returning to the parser. Upon return to the parser from your processing procedure, the parser transfers control to the ON EXCEPTION phrase in the XML PARSE statement, if specified; otherwise the parser transfers control to the end of the XML PARSE statement. XML-CODE contains the original exception code set by the parser.
For XMLPARSE(COMPAT)
When XMLPARSE(COMPAT) is in effect, you might be able to handle the exception in your processing procedure and continue parsing if the numeric exception code is within one of the following ranges:
If the exception code has any other nonzero value, parsing cannot continue. The exceptions for encoding conflicts (50-99 and 300-399) are signaled before the parsing of the document begins. For these exceptions, XML-TEXT or XML-NTEXT either is of length zero or contains only the encoding declaration value from the document.
Exceptions in the range 1-49 are fatal errors according to the XML specification. Therefore the parser does not continue normal parsing even if you handle the exception. However, the parser does continue scanning for further errors until it reaches the end of the document or encounters an error that does not allow continuation. For these exceptions, the parser does not signal any further normal events except the END-OF-DOCUMENT event.
related concepts
XML-CODE