Given a set of xml records and a set of terms $terms . The terms in $terms sequence are extracted from the set of records. I want to count the number of occurrences of each term in each paragraph record. I used the following code to do so:
for $record in /rec:Record
for $term in $terms
retu xdmp:unquote(concat('<info>',string(count(lower-case($record/rec:paragraph )[. = lower-case($term)])), '</info>'))
For each term in each record i got 0 count:
Any idea of what caused this result? Is there any other way to count the number of occurrences of each of the terms in each paragraph.

