Sign in

docs RPG Guide

XML Parser Error Codes

XML Parser Error Codes

If the XML parser detects an error in the XML document during parsing, message RNX0351 will be issued. From the message, you can get the specific error code associated with the error, as well as the offset in the document where the error was discovered.

The following table shows the meaning of each parser error code:

XML Parser Error CodeDescription
1The parser found an invalid character while scanning white space outside element content.
2The parser found an invalid start of a processing instruction, element, comment, or document type declaration outside element content.
3The parser found a duplicate attribute name.
4The parser found the markup character ’<’ in an attribute value.
5The start and end tag names of an element did not match.
6The parser found an invalid character in element content.
7The parser found an invalid start of an element, comment, processing instruction, or CDATA section in element content.
8The parser found in element content the CDATA closing character sequence ’]]>’ without the matching opening character sequence ’<![CDATA[‘.
9The parser found an invalid character in a comment.
10The parser found in a comment the character sequence ’—’ (two hyphens) not followed by ’>‘.
11The parser found an invalid character in a processing instruction data segment.
12A processing instruction target name was ‘xml’ in lowercase, uppercase or mixed case.
13The parser found an invalid digit in a hexadecimal character reference (of the form �, for example &#x0eb1).
14The parser found an invalid digit in a decimal character reference (of the form &#dddd;).
15A character reference did not refer to a legal XML character.
16The parser found an invalid character in an entity reference name.
17The parser found an invalid character in an attribute value.
18The parser found a possible invalid start of a document type declaration.
19The parser found a second document type declaration.
20An element name was not specified correctly. The first character was not a letter, ’_’, or ’:’, or the parser found an invalid character either in or following the element name.
21An attribute was not specified correctly. The first character of the attribute name was not a letter, ’_’, or ’:’, or a character other than ’=’ was found following the attribute name, or one of the delimiters of the value was not correct, or an invalid character was found in or following the name.
22An empty element tag was not terminated by a ’>’ following the ’/‘.
23The element end tag was not specified correctly. The first character was not a letter, ’_’, or ’:’, or the tag was not terminated by ’>‘.
24The parser found an invalid start of a comment or CDATA section in element content.
25A processing instruction target name was not specified correctly. The first character of the processing instruction target name was not a letter, ’_’, or ’:’, or the parser found an invalid character in or following the processing instruction target name.
26A processing instruction was not terminated by the closing character sequence ’?>‘.
27The parser found an invalid character following ’&’ in a character reference or entity reference.
28The version information was not present in the XML declaration.
29The ‘version’ in the XML declaration was not specified correctly. ‘version’ was not followed by ’=’, or the value was missing or improperly delimited, or the value specified a bad character, or the start and end delimiters did not match, or the parser found an invalid character following the version information value closing delimiter in the XML declaration.
30The parser found an invalid attribute instead of the optional encoding declaration in the XML declaration.
31The encoding declaration value in the XML declaration was missing or incorrect. The value did not begin with lowercase or uppercase A through Z, or ‘encoding’ was not followed by ’=’, or the value was missing or improperly delimited or it specified a bad character, or the start and end delimiters did not match, or the parser found an invalid character following the closing delimiter.
32The parser found an invalid attribute instead of the optional standalone declaration in the XML declaration.
33The ‘standalone’ attribute in the XML declaration was not specified correctly. ‘standalone’ was not followed by a ’=’, or the value was either missing or improperly delimited, or the value was neither ‘yes’ nor ‘no’, or the value specified a bad character, or the start and end delimiters did not match, or the parser found an invalid character following the closing delimiter.
34The XML declaration was not terminated by the proper character sequence ’?>’, or contained an invalid attribute.
35The parser found the start of a document type declaration after the end of the root element.
36The parser found the start of an element after the end of the root element.
300The parser reached the end of the document before the document was complete.
301The %HANDLER procedure for XML-INTO or XML-SAX returned a non-zero value, causing the XML parsing to end.
302The parser does not support the requested CCSID value or the first character of the XML document was not ’<‘.
303The document was too large for the parser to handle. The parser attempted to parse the incomplete document, but the data at the end of the document was necessary for the parsing to complete.
500-999Internal error in the external parser. Please report the error to your service representative.
10001-19999Internal error in the parser. Please report the error to your service representative.