Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question, Peter.
Asked: October 10, 2016 - 1:28 pm UTC
Last updated: October 11, 2016 - 8:46 am UTC
Version: 11.2.0.1.0
Viewed 1000+ times
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs> <typ:DDD> <typ:EEE>10</typ:EEE> <typ:FFF>11</typ:FFF> </typ:DDD> <typ:DDD> <typ:EEE>20</typ:EEE> <typ:FFF>22</typ:FFF> </typ:DDD> ... </typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope>
select xmlquery('declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope/"; declare namespace web = "http://www.abc.com"; declare namespace typ = "http://www.def.com"; (: :) copy $i := $p1 modify ( for $j in $i/soapenv:Envelope/soapenv:Body/web:AAA/web:BBB/typ:DDD/typ:DDDs return insert nodes $p2 as last into $j ) return $i' passing column_value as "p1", xmltype ( '<typ:DDD> <typ:EEE>test</typ:EEE> <typ:FFF>test</typ:FFF> </typ:DDD>' ) as "p2" returning content) xml from xmltable('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs></typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope>'); ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00234: namespace prefix "typ" is not declared Error at line 1 ORA-06512: at "SYS.XMLTYPE", line 310 ORA-06512: at line 1 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. select xmlquery(' declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope/"; declare namespace web = "http://www.abc.com"; declare namespace typ = "http://www.def.com"; (: :) copy $i := $p1 modify ( for $j in $i/soapenv:Envelope/soapenv:Body/web:AAA/web:BBB/typ:DDD/typ:DDDs return insert nodes $p2 as last into $j ) return $i' passing column_value as "p1", xmltype ( '<typ:DDD xmlns:typ="http://www.def.com"> <typ:EEE>test</typ:EEE> <typ:FFF>test</typ:FFF> </typ:DDD>' ) as "p2" returning content) xml from xmltable('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs></typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope>'); <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs> <typ:DDD> <typ:EEE>test</typ:EEE> <typ:FFF>test</typ:FFF> </typ:DDD> </typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope> select appendchildXML(column_value, 'soapenv:Envelope/soapenv:Body/web:AAA/web:BBB/typ:DDD/typ:DDDs', xmltype ( '<typ:DDD xmlns:typ="http://www.def.com"> <typ:EEE>test</typ:EEE> <typ:FFF>test</typ:FFF> </typ:DDD>' ), 'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"') xml from xmltable('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs></typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope>'); <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.def.com" xmlns:web="http://www.abc.com"> <soapenv:Header /> <soapenv:Body> <web:AAA> <web:BBB> <typ:Version>1.0</typ:Version> <typ:DDD> <typ:EEE>999</typ:EEE> <typ:FFF>888</typ:FFF> <typ:DDDs> <typ:DDD> <typ:EEE>test</typ:EEE> <typ:FFF>test</typ:FFF> </typ:DDD> </typ:DDDs> </typ:DDD> </web:BBB> </web:AAA> </soapenv:Body> </soapenv:Envelope>
Peter, October 11, 2016 - 10:06 am UTC
Complete documentation on Securefiles and Large Objects here