Skip to content

Instantly share code, notes, and snippets.

@vakiliy
Last active December 31, 2015 11:49
Show Gist options
  • Save vakiliy/6eaf2f468aea1f366db5 to your computer and use it in GitHub Desktop.
Save vakiliy/6eaf2f468aea1f366db5 to your computer and use it in GitHub Desktop.
xml+xslt unique values Year
<xsl:if test="count(.//year) != 0">
<div>
<xsl:for-each select=".//year[generate-id() = generate-id(key('years',.)[1])]">
<xsl:if test="./text() = /.//selected_year ">
<xsl:attribute name="class">current</xsl:attribute>
</xsl:if>
<xsl:if test="position() = 1"></xsl:if><xsl:value-of select="." /> г.
</xsl:for-each>
</div>
</xsl:if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment