0

I'd like to replace "~" of element with the value of element using xquery (Update facility). Is this possible?

Sample.xml

<entry>
<keyword>ace</keyword>
<example>~ card</example>
</entry>

Result.xml

<entry>
<keyword>ace</keyword>
<example>ace card</example>
</entry>
user1610952
  • 1,249
  • 1
  • 16
  • 31

1 Answers1

1

Below Xquery will modify the node value.

for $i in /entry
  return replace($i/example, '~', $i/keyword);

Now, if you want to update the node with this value, you should let us know with which engine you are running the Xquery.

Jayy
  • 2,368
  • 4
  • 24
  • 35