ORA31011 - XML parsing Failed

5.9k Views Asked by At

I have a SQL script that Im building to make a structure, this is the oracle version Im working with "Oracle Database 10g Release 10.2.0.4.0 - 64bit Production", then this is the script:

XMLELEMENT("cbc:InvoicedQuantity", xmlattributes('PEN' as "/@unitCode"))

this is the line that give me the error. I think xml cant parse this characters "/" or "@", is there any solution for this? please, i need help.

1

There are 1 best solutions below

0
On

Try to use something like this, maybe it can help.

select replace(xmlelement("cbc:InvoicedQuantity", xmlattributes('PEN' as "
unitCode")),chr(10),'/@')
from dual;

The idea is to use line-break (or any other useless symbol) to replace it with the symbols needed later.