Hi Pascal,
it comes down to a syntax error - there's a 'return' statement missing
before the 'copy'. It should work like this:
let $codeBook := collection()[1]/ddi:codeBook
let $titlStmt := $codeBook/ddi:stdyDscr/ddi:citation/ddi:titlStmt
return copy $titlStmt1 := $titlStmt
modify (
rename node $titlStmt1 as
)
return $titlStmt1
I always check queries in the Query Editor of BaseX if I come across
issues like this. Just as a hint ...
Cheers,
Lukas