Subject:word count for each category Author:c doniat Date:28 Nov 2007 03:17 AM Originally Posted: 27 Nov 2007 09:41 AM
Hi,
I'm newbie in XML/XQuery. I have this XML file (below) and I try to extract some data as : I would like this list of unique name of each category and for each category, I'd like the number of words
for $cat in distinct-values(wordset/word/@category)
return <result>
{$cat},
{sum(for $wcount in wordset/word[@category=$cat]
return count($wcount))}
</result>