Hi Günter,
The query does the replacement, but not the deletion.
I see. This is due to the semantics of XQuery Update: All update operations refer to the original nodes [1]. In the given query…
let $data := document { <s>KEEP <del>DELETE</del></s> } return $data update ( delete node .//del, replace value of node s with normalize-space(s) )
…the "del" nodes will be deleted in the original document, and the value of element "s" will be replaced with the normalized string of the original element "s"…
The following queries will do what you want:
QUERY A: document { <s>KEEP <del>DELETE</del></s> } update ( replace value of node ./s with normalize-space( ./s update ( delete node .//del ) ) )
QUERY B: let $data0 := document { <s>KEEP <del>DELETE</del></s> } let $data1 := $data0 update delete node .//del let $data2 := $data1 update replace value of node s with normalize-space(s) return $data2
Btw., searching in my App with the new final index is a pleasure. It’s much faster than ever before (mostly under or near one second in browser) and completely with mark-elements tagged. Great! Thanks for your great support.
Thanks for the kudos; and thanks for spending time on precise questions; this makes our life much easier.
Christian