Monday, 15 June 2015

how to remove namespace from an existing xml subtree in oracle -



how to remove namespace from an existing xml subtree in oracle -

i'm facing issue removing namespace existing xml subtree.

for example: have table 1 field - info type xmltype. 1 entry holding xml:

<item xmlns="http://www.w3.org/2001/xmlschema-instance"> <box>blaff</box> <door>steal</door> <chair>wood</chair> </item>

i remove namespace - i.e.:

<item> <box>black-box</box> <door>steal</door> <chair>wood</chair> </item>

do have suggestions? - tried using update() function no luck. give thanks much help.

one thought transform clob, replace namespace string , transform xml:

xtab ( select xmltype('<item xmlns="http://www.w3.org/2001/xmlschema-instance"> <box>blaff</box> <door>steal</door> <chair>wood</chair> </item>') my_xml dual) select xmltype(replace(xmltype.getclobval(my_xml), ' xmlns="http://www.w3.org/2001/xmlschema-instance"', '')) clo xtab;

oracle

No comments:

Post a Comment