LPX-00231: invalid character 32 (' ') found in a Name or Nmtoken when transforming (Doc ID 2274939.1)

Last updated on JUNE 20, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Information in this document applies to any platform.

Symptoms

On a table containing XML and an XSL in another table (the XSL contains javascript in CDATA section) when using the database functionality to transform the xml by xsl it seems that the CDATA is parsed and LPX-00231: invalid character 32 (' ') found in a Name or Nmtoken is encountered.

ERROR:

SQL> create or replace PROCEDURE testxsltransform
AS
l_xml_result XMLTYPE;
l_xsl_sheet CLOB;
BEGIN
select a into l_xsl_sheet from bb where id = 1;
select XMLTYPE.createXML(a) into l_xml_result from bb where id = 2;
l_xml_result := l_xml_result.transform (XMLTYPE (l_xsl_sheet));
insert into bb values (l_xml_result.getClobVal(), 3);
commit;
exception
when others then raise;
end;
/

SQL> exec testxsltransform;
BEGIN testxsltransform; END;

*
ERROR at line 1:
ORA-31011: XML parsing failed
ORA-31011: XML parsing failed
ORA-19213: error occurred in XML processing at lines 7
LPX-00231: invalid character 32 (' ') found in a Name or Nmtoken
ORA-06512: at "SCOTT.TESTXSLTRANSFORM", line 12
ORA-06512: at line 1

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