views:

29

answers:

1

Hi,

does anybody know a way of determining the number of times in which a particular value occurs in a sequence, with XQuery.

Thanks in advance

+1  A: 

Use:

count(index-of($value, $sequence))
Dimitre Novatchev
What I wanted to do this with all the values on the sequence and return the most frequent? let $counter := 0, $index1 := 0for $value in $sequenceif (count(index-of($value, $sequence)))then { $counter := count(index-of($value, $sequence)) $index1 := index-of($value)}else {}...
deb
This counts as a *new* question. Please, ask it as a question and I'll try to find a good one-liner.
Dimitre Novatchev
Ok, I'm sorry :)
deb