How to modify one only branch of a list

Hi,
I want to modify only the last branch of a list. I’m trying with this XQuery but I don’t know what is wrong. This is my query:

update $a in input()/DVD/Media/DMS1:ClipFramework[last()]
do (
replace $a/rp210Elements:ClipNumber/text() with 33
replace $a/rp210Elements:TakeNumber/text() with 35
)

I will be grateful if someone could help me,
Regards,
Diego

Hi Diego,

try



update for $a in input()/DVD/Media/DMS1:ClipFramework[last()]
do (
replace $a/rp210Elements:ClipNumber/text() with 33
replace $a/rp210Elements:TakeNumber/text() with 35
)

and add your namespace declarations as well

Regards

harald

Hi, Thanks a lot for your help. Finally it works with the following XQuery:

update
let $a:= input()/DVD/Media/DMS1:ClipFramework[last()]
do (
replace $a/rp210Elements:ClipNumber/text() with 79
replace $a/rp210Elements:TakeNumber/text() with 79
)

Thanks a lot for your collaboration,
Regards,
Diego