APPENDCHILDXML with namespace_string
(10gR2)
Having issues with a simple append child. I suspect the issue is the namespace but I have declared using namespace_string.
The output I'm expecting should be:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ers:OPS xmlns:ers="http://www.test.com/schema/ers/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.test.com/schema/ers/v3">
<ers:LOG xmlns:ers="http://www.test.com/schema/ers/v3" TEST="TESTVAL" >
</ers:LOG>
</ers:OPS>
However, the LOG child element is not being added.
Script is:
Declare
v_xmltmp XMLTYPE;
Begin
Select Appendchildxml(Xmltype('<?xml version="1.0" encoding="ISO-8859-1"?><ers:OPS xmlns:ers="http://www.test.com/schema/ers/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.test.com/schema/ers/v3"></ers:OPS>')
,'/OPS'
,Xmltype('<ers:LOG xmlns:ers="http://www.test.com/schema/ers/v3" TEST="TESTVAL" ></ers:LOG>'),'xmlns:ers="http://www.test.com/schema/ers/v3"')
Into V_Xmltmp
From Dual d;
dbms_output.put_line(XML: '||v_xmltmp.getclobval());
END;