Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010

    Unanswered: how to rename XML attribute?


    How to rename xml attribute for all xml data in one table

    <term id ="1">
    I want to rename 'id' to 'term_id'

    so that my new xml data will be look like this

    <term term_id ="1">
    This is my basic code which I used to rename XML tag from definision to definition .

    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.

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    Did you have a chance to look at examples in the manual, particularly the XPath notation for attributes?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts