Vælg unikke elementer med XSLT
Kan ikke få dette xslt til at virke - Kan simpelthen ikke se hvad jeg gør galt??JEg har prøvet at følge guiden på : http://www.bernzilla.com/item.php?id=333
----------------
<?xml version="1.0" encoding="UTF-8"?>
<?via version="3.2" snippet="DocumentList"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" encoding="UTF-8"/>
<xsl:key name="prodnames" match="Documents/Document/DocumentEdition/Fields/Field[@Name='ProductName']" use="."/>
<xsl:template match="Documents">
<ul class="prods">
<xsl:apply-templates select="Document"/>
</ul>
</xsl:template>
<xsl:template match="Document">
<xsl:for-each select="DocumentEdition/Fields/Field[@Name='ProductName'][generate-id() = generate-id(key('prodnames',/.))[1])]">
<xsl:value-of select="."/>
</xsl:for-each>
<li class="proditem">
<!-- <a href="?id={@Id}">-->
<!-- <a href="{Usage/Page/AbsoluteUrl}"> -->
<a href="{TargetPage/AbsoluteUrl}">
» <xsl:value-of select="DocumentEdition/Fields/Field[@Name='ProductName']"/>
<!--<xsl:apply-templates select="DocumentEdition/Fields/Field[@Name='Type']" />-->
<!-- <xsl:value-of select="Name"/> -->
<!--<xsl:value-of select="DocumentEdition/Fields/Field[@Name='Title']"/>-->
</a>
<!--<xsl:value-of select="DocumentEdition/Fields/Field[@Name='Description']"/>-->
</li>
</xsl:template>
<xsl:template match="/Module">
<xsl:apply-templates select="//Row"/>
</xsl:template>
<xsl:template match="Row">
<xsl:apply-templates select="Cell"/>
</xsl:template>
<xsl:template match="Cell">
<xsl:value-of disable-output-escaping="yes" select="ContentArea"/>
</xsl:template>
<xsl:template match="RequestContent"/>
</xsl:stylesheet>