Hi Julien,
So, what we first thought of was creating a transaction, executing the update/replace operations, perform the validation, and if the result of the operations result in invalid XML, perform a rollback.
I would recommend you to use a non-updating expression [1], validate the result and store it in a second step. The query could look as follows:
let $input := db:open('db')/a/b/c let $result := copy $c := $input modify delete node $c//text() return $c return try { validate:xsd($result, 'schema.xsd'), (: validation was successful... :) replace node $input with $result } catch BXVA0001 { db:output("Validation failed: " || $err:description) }
Rollback features are on our agenda and may be introduced along with MVCC or even earlier, but I cannot give any timeline yet.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/XQuery_Update#Non-Updating_Expressions