View Single Post
 
Old November 13th, 2008, 07:38 PM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The simplest is

count($values) = count(distinct-values($values))

In practice you may be interested then to find out where the duplicates are, which you can do using for-each-group

<xsl:for-each-group select="$values" group-by=".">
  <xsl:if test="count(current-group()) gt 1">
     ...

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference