Parsing of XML fails with ORA-31011, LPX-00283 After DB Upgrade from 10g to 11g

(Doc ID 1302083.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Database - Enterprise Edition - Version and later
Information in this document applies to any platform.
***Checked for relevance on 02-Dec-2013***


After upgrading the database from to, a piece of code that functioned fine in 10g now fails in 11g.  The file loaded into the XML parser has special characters in it.

Error Message:

ERROR at line 1:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00283: document encoding is UTF-16-based but default input encoding is not
Error at line 1
ORA-06512: at "XDB.DBMS_XMLPARSER", line 119
ORA-06512: at line 10

Below is the first line of the XML file:

\220\221<?xml version="1.0" encoding="utf-16"?>

If "\220\221" is removed from this line, the file processes correctly:

PL/SQL Code being used:

    parser                  xmlParser.parser;
    newDomDoc               xmlDom.domDocument;
    retdoc                  xmlDom.domDocument;
    newElem                 xmlDom.domElement;
    parser := xmlParser.newParser;
    retdoc := xmlParser.getDocument(parser);


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms