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
-- 
Dr. phil. Cerstin Mahlow

Universität Basel
Departement Sprach- und Literaturwissenschaften
Fachbereich Deutsche Sprach- und Literaturwissenschaft
Nadelberg 4
4051 Basel
Schweiz

Tel:  +41 61 267 07 65
Fax: +41 61 267 34 40
Mail: [email protected]
Web: http://www.oldphras.net

_______________________________________________
BaseX-Talk mailing list
[email protected]
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to