Unique list of nodes XSLT

Hi all,

I’m trying desperately to get a unique list of year/month published dates from my content. All the examples that I’ve seen are advising me to use ‘keys’ but however hard I try I can’t get any output whatsoever using this approach.

Here’s my basic XSLT what produces a list of yyyy-mm outputs.

<xsl:template match=“/”>
<xsl:variable name=“news” select=“$currentPage/ancestor-or-self::*[@isDoc and @level=1]/descendant::NewsItem[@isDoc]”/>

<xsl:for-each select="$news">
	<xsl:value-of select="substring(@updateDate, 0,8)"/><br/>
</xsl:for-each>

Could someone give me some pointers please on how I can get a distinct list of yyyy-mm please?

thanks,
Craig


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/67300-unique-list-of-nodes-xslt