[xquery-talk] search hit count
mhk at mhk.me.uk
Thu Jul 20 22:04:12 PDT 2006
> The XML structure is basic TEI.
There are many XML vocabularies and many of them are widely used, but it
would be a mistake to assume that readers of this list are familiar with all
> So, to get a more accurate
> count, I need to count all p, title, l, hi, etc.. tags that
> contain the keyword?
If you want to count the number of occurrences of $keyword anywhere within
element X, a close estimate would be
(Not exact, because of occurrences that are adjacent to each other or to the
start or end).
Or you could do
(string-length(X) - string-length(replace(X, $keyword, ''))) div
More information about the talk