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 11.1.0.7 and later
Information in this document applies to any platform.
***Checked for relevance on 02-Dec-2013***

Symptoms

After upgrading the database from 10.1.0.3 to 11.1.0.7, 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:

DECLARE
    parser                  xmlParser.parser;
    newDomDoc               xmlDom.domDocument;
    retdoc                  xmlDom.domDocument;
    newElem                 xmlDom.domElement;
BEGIN                
    parser := xmlParser.newParser;
    xmlparser.parse(parser,'/home/scott/test.xml');
    retdoc := xmlParser.getDocument(parser);
    newElem:=xmlDom.getDocumentElement(retdoc);
END;
/

Cause

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