Hi Roger, What you were expecting might correspond to the following XQuery Scripting Extension program (mind the semi-colons, which apply the PUL): let $source := doc(‘FitnessCenter. xml ‘) for $i in $source//Member return ( delete node $i/Name; replace node $i/@level with attribute {‘id’} {data($i/Name)}; ) With this program, for each member, the second instruction sees the side effect of the first instruction – unlike your original XQuery Update Facility program, it should fail and the attribute id will be empty. In an XQuery Update Facility (XQUF) program, as Markus said, you will not see any side effects during the execution of the program (this is called snapshot semantics).
Read the rest here:
[Newbie] Why can I delete an element and then use
its value?
