Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APPENDCHILDXML with namespace_string

User_EXO6NNov 1 2012 — edited Nov 2 2012
(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;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2012
Added on Nov 1 2012
3 comments
1,250 views