Skip to Main Content

Database Software

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!

How to remove the XMLNS attribute from the root element?

user49914949919675123Jan 30 2015 — edited Feb 9 2015

I have an XML like this.

<caseactions

     xmlns="http://www.w3schools.com"

     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

     xsi:schemaLocation="http://www.w3schools.com case_actions_info.xsd"

     source="argus"     

     client_id="CL2">

     <caseid>101296</caseid>

</caseactions>

Before I insert this to a table (CLOB column) I want to get rid of the 1st 3 attributes. i.e. xmlns, xmlns:xsi and xsi:schemaLocation.

After reading the XML DB user guide (my DB is 11g R2) I tried this:

Select Updatexml(Xmltype('<caseactions xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com case_actions_info.xsd" source="argus" client_id="CL2"><caseid>101296</caseid></caseactions>'),

    '/caseactions/@xmlns', NULL) FROM dual;

But, this does not work. The attribute is still there.

What am I doing wrong here?  Any help would be greatly appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2015
Added on Jan 30 2015
9 comments
10,190 views