Hi Christian,
here’s my code:
let $input := "<s> <w>u.<reg>und</reg> </w> <w>für</w> <w>die</w> <w>Folge</w> <w>da</w> <w>werden</w> <w>Sie</w>, <persName> <w>Gnädigste<reg>gnädigste</reg></w> <lb/> <w>Tante<c>,</c></w> </persName> <note>Anmerkungstext</note> <w>schon</w> <w>sorgen</w>. </s>“
let $xml := parse-xml($input) return $xml update ( for $s in s return (delete node .//(note|reg), replace value of node $s with normalize-space($s)) )
The output is: <s>u.und für die Folge da werden Sie, Gnädigstegnädigste Tante, Anmerkungstext schon sorgen.</s>
The query does the replacement, but not the deletion.
In my app currently I’m building two new indices, the first one with deletion, based on that one the replacement. It would be nice, to combine it in one query.
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.
Best, Günter
Am 07.01.2016 um 11:31 schrieb Christian Grün christian.gruen@gmail.com:
Could you possibly copy and paste the query I send to you in my last response, and modify it that it allows me to reproduce the problem out-of-the-box?
On Thu, Jan 7, 2016 at 11:29 AM, kleist-digital kleist@mail.dunzwolff.de wrote:
<item> <s xmlns="http://www.tei-c.org/ns/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="N111A6">JeztJetzt darf ich zu dem Mittel meine Zuflucht noch nicht ergreifen nehmen, u.und für die Folge da werden Sie, Gnädigstegnädigste <mark>Tante</mark>, schon sorgen.</s> <s xmlns="http://www.tei-c.org/ns/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="N111A6">JeztJetzt darf ich zu dem Mittel meine Zuflucht noch nicht ergreifen nehmen, u.und für die Folge da werden Sie, Gnädigstegnädigste Tante, schon sorgen.</s> </item>
The query is db:create('kleist_index_search‘, for $item in db:open('kleist-data‘) return $item update (delete node .//(tei:note|tei:rdg|tei:lb|tei:del|tei:reg|tei:sic), for $s in .//tei:s return replace value of node $s with normalize-space($s)), db:open('kleist-data')/db:path(.))