ErrorLog XML schema definition for enhanced error message support

The ErrorLog XML schema definition (XSD) describes the UTF-8 XML document generated by the XSR_GET_PARSING_DIAGNOSTICS stored procedure as result of a parsing and validation errors in a XML document. The output XML document is stored in the errorDialog argument.

ErrorLogType

The root element of the XML schema definition is ErrorLog and is of type ErrorLogType.

XML schema definition

<xs:complexType name="ErrorLogType">
  <xs:sequence>
    <xs:element name="XML_Error" type="XML_ErrorType" minOccurs="0" 
          maxOccurs="unbounded"/>
    <xs:element name=name="XML_FatalError" type="XML_ErrorType" minOccurs="0" 
          maxOccurs="unbounded"/>
    <xs:element name="DB2_Error" type="DB2_ErrorType"/>
  </xs:sequence>
</xs:complexType>

Subelements

XML_Error
XML_FatalError
Type:
XML_ErrorType
Usage notes:
An XML_Error or XML_FatalError element contains an XML parser generated error message. Both elements XML_Error and XML_FatalError are of the same XML schema type. XML_FatalError is an error that causes the XML parser to abort the parsing process.
 xs:complexType name="XML_ErrorType">
  <xs:sequence>
    <xs:element name="errCode"    type="xs:int"/>
    <xs:element name="errDomain"  type="xs:string"/>
    <xs:element name="errText"    type="xs:string"/>
    <xs:element name="lineNum"    type="xs:unsignedInt"/>
    <xs:element name="colNum"     type="xs:unsignedInt"/>
    <xs:element name="location"   type="xs:string"/>
    <xs:element name="schemaType" type="xs:string"/>
    <xs:element name="tokens">
      <xs:complexType>
        <xs:sequence minOccurs="0">
          <xs:element name="token" type="xs:string" minOccurs="0" 
               maxOccurs="unbounded"/>
       </xs:sequence>
       <xs:attribute name="count" type="xs:unsignedByte" 
            use="required"/>
    </xs:complexType>
   </xs:element>
  </xs:sequence>
 <xs:attribute name="parser" type="xs:string" use="required"/>
</xs:complexType>

XML_ErrorType element contains the following subelements:

errCode
A XML Parser returned error code.
errDomain
A XML Parser returned error domain.
errText
A original XML parser error message.
lineNum
A line number where the error occurred.
colNum
A column number where the error occurred.
location
Location is an XPath expression that points to the last XML element before the error occurred.
schemaType
A XML Schematype of the last parsed XML Element.
tokens
A numeric value that shows how many token are reported.
token
A Token is string value that is used to produce the Db2® error message.

Attributes

parser (required)
The parser attribute specifies the underlying XML parser that was used.
DB2_Error
Type:
DB2_ErrorType
Usage notes:
A DB2_Error element contains the Db2 error message.
<xs:complexType name="DB2_ErrorType">
  <xs:sequence>
    <xs:element name="sqlstate" type="xs:string"/>
    <xs:element name="sqlcode"  type="xs:int"/>
    <xs:element name="errText"  type="xs:string"/>
  </xs:sequence>
 <xs:attribute name="parser" type="xs:string" use="required"/>
</xs:complexType>

DB2_ErrorType element contains the following subelements:

sqlstate
A SQLSTATE
sqlcode
A SQLCCODE
errText
A Db2 error message