Hello
How to rename xml attribute for all xml data in one table
example
Quote:
<term id ="1">
<term>book</term>
<definition></definition>
</term>
|
I want to rename '
id' to '
term_id'
so that my new xml data will be look like this
Quote:
<term term_id ="1">
<term>book</term>
<definition></definition>
</term>
|
This is my basic code which I used to rename XML tag from
definision to
definition .
Quote:
update term
set term = xmlquery('copy $new := $TERM
modify( for $j in $new/term/definision
return do rename $j as "definition")
return $new' );
|
Which part do I have to alter which code above to rename attributes.
Thank You.