简体   繁体   中英

XQuery-Update: Target node of insert expression is not updateable

Running this code

copy $foo := <foo />
modify (
  insert node <bar /> into $foo
)
return $foo

in Saxon-EE 9.6.0.7 (form Oxygen 18) I get the Error

Target node of insert expression is not updateable

BaseX returns <foo><bar/></foo>

Who is right? Is there another way to modify any xml-expression, not just those loaded by doc() (which works with Saxon)?

You need to set the option -tree:linked to ensure that Saxon runs using an updatable tree model. The default tree model is immutable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM