Hi,
I got stuck with an XQuery, could you please help?
I have data like this:
<collection> <entry> <q>[text() contains text ('Johann' ftand 'Ballhorn') distance at most 5 words ordered][self::*:p or self::*:q]</q> <id>12345</id> <p>bey welchen die Verbesserungen durch Johann Ballhorn öfter vorkommen als man glauben sollte.</p> </entry> <entry>… </collection>
All I want to get back is the <p> node with the content of the <q> node applied to <p> using ft:mark, i.e., the node with highlighting like this:
<p>bey welchen die Verbesserungen durch <mark>Johann</mark> <mark>Ballhorn</mark> öfter vorkommen als man glauben sollte.</p>
But I don't manage to call ft:mark with the correct parameters.
I tried variants of this:
for $i at $p in //entry let $q := $i/q return ft:mark($i $q)
But this gives
Expecting closing bracket for 'ft:mark(…'
I think I have to use concat() in some way, but how?
Thanks in advance
Cerstin