That's exactly what I want !
Thanks a lot !
Christophe
Le 2015-06-09 10:58, Christian Grün a écrit :
Hi Christophe,
I do not want to avoid the updates, but really want to throw an error.
I'm not sure how to interpret your statement.. Do you want to execute
the updates AND throw an error?
If you throw an error, your updates won't be executed, so this may
already be what you need. See the following example..
let $data := <my-data/>
return if($data/*) then (
insert node $data into db:open('db')/xml
) else (
error((), 'Root has no child elements!')
)
Best,
Christian