Use
for-each select="event/date[count(. | key('date', .)[1]) = 1]"
instead of what you have.
And be aware that sorting dates in the format yyyy-mm-dd is possible, but some of the XML input samples you posted have a format like 8th October 2010 and sorting on that is not possible, you would first need to transform the format into something sortable with XSLT 1.0 (i.e. 'yyyy-mm-dd' or yyyymmdd).
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
|