Oracle XML parsing échoué , de caractère non valide a trouvé un Nom ou Nmtoken

Le code ci-dessous fonctionne bien pour les non-entiers bien .

J'ai plusieurs balises avec des entiers ( dire <1> , <2> etc),

SET serveroutput ON
alter session set cursor_sharing = exact;
with xmldata(d) as (select xmltype('<ROWSET><ROW><1>ABC</1></ROW></ROWSET>') from dual
)
select x.*
FROM xmldata,
     xmltable('ROWSET/ROW' passing xmldata.d
              columns
              name varchar2(10) path '1'
     ) x
;

J'ai essayé d'utiliser cette aussi:

DECLARE
l_xml xmltype;
l_val VARCHAR2(1000) := '<ROWSET><ROW><1>ABC</1></ROW></ROWSET>';
BEGIN
     l_xml        := xmltype(l_val);
end;

Les deux conduit à une erreur ci-dessous:

Error report:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00231: invalid character 49 ('1') found in a Name or Nmtoken
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 310
ORA-06512: at line 5
31011. 00000 -  "XML parsing failed"
*Cause:    XML parser returned an error while trying to parse the document.
*Action:   Check if the document to be parsed is valid.

Merci d'avance et appréciations:)

  • Oracle version utilisez-vous?
  • 11.2.0.1.0...
  • Eeek....c'est la version de base pour 11gR2. Je recommande fortement la mise à niveau vers 11.2.0.4.0 ASAP.
InformationsquelleAutor ajmalmhd04 | 2013-10-30