Udskriver samme kommune flere gange?
Har noget XSLT der spytter kommuner ud alt efter hvilken region du er fra... Hvis jeg så har 3 firmaer der ligger i samme kommune, udskriver den så samme kommunes navn 3 gange i min select, men vil kun have den til at udskrive kommunen 1 gang i select... Hvordan laver jeg lige det her:<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="regions-by-region" match="Field[@Name = 'Region']" use="text()" />
<xsl:key name="municipality-by-region" match="Field[@Name = 'Municipality']" use="../Field[@Name='Region']/text()" />
<xsl:key name="reseller-by-municipality" match="Fields" use="Field[@Name='Municipality']/text()" />
<xsl:variable name="editionId"><xsl:value-of select="//EditionId" /></xsl:variable>
<xsl:variable name="selectedRegion"><xsl:value-of select="//RequestContent/QueryString/Entry[@Name='region']" /></xsl:variable>
<xsl:variable name="selectedMunicipality"><xsl:value-of select="//RequestContent/QueryString/Entry[@Name='municipality']" /></xsl:variable>
<xsl:template match="Documents">
<div id="retailerform">
<!--selectedRegion:<xsl:value-of select="$selectedRegion"/><br />selectedMunicipality:<xsl:value-of select="$selectedMunicipality"/><br />-->
<form action="" method="get" id="resellerSelector">
<span id="regionSelector">
<select name="region" onchange="if($('municipality')) $('municipality').selectedIndex = -1 ;$('resellerSelector').submit()">
<xsl:if test="$editionId = '1'">
<option>Vælg region:</option>
</xsl:if>
<xsl:if test="$editionId = '2'">
<option>Välj län:</option>
</xsl:if>
<xsl:if test="$editionId = '3'">
<option>Velg fylke:</option>
</xsl:if>
<xsl:if test="$editionId = '4'">
<option>Choose region:</option>
</xsl:if>
<xsl:for-each select="Document/DocumentEdition/Fields/Field[@Name='Region'][count(. | key('regions-by-region', text())[1]) = 1]">
<option><xsl:if test="//RequestContent/QueryString/Entry[@Name='region'] = text()"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:value-of select="text()" /></option>
</xsl:for-each>
</select>
</span>
<xsl:if test="$selectedRegion != ''">
<span id="municipalitySelector" style="padding-left: 100px;">
<select name="municipality" id="municipality" onchange="$('resellerSelector').submit()">
<xsl:if test="$editionId = '1'">
<option>Vælg kommune:</option>
</xsl:if>
<xsl:if test="$editionId = '2'">
<option>Välj kommun:</option>
</xsl:if>
<xsl:if test="$editionId = '3'">
<option>Velg kommune:</option>
</xsl:if>
<xsl:if test="$editionId = '4'">
<option>Choose municipality:</option>
</xsl:if>
<!--xsl:for-each select="Document/DocumentEdition/Fields/Field[@Name='Municipality'][count(. | key('municipality-by-region', $selectedRegion)[1]) = 1]"-->
<xsl:for-each select="key('municipality-by-region', $selectedRegion)">
<option><xsl:if test="//RequestContent/QueryString/Entry[@Name='municipality'] = text()"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if><xsl:value-of select="." /></option>
</xsl:for-each>
</select>
</span>
<div class="reset"> </div>
</xsl:if>
</form>
</div>
<br />
<br />
<xsl:for-each select="key('reseller-by-municipality', $selectedMunicipality)">
<xsl:if test="$selectedMunicipality != ''">
<div class="wrapRegion">
<xsl:if test="Field[@Name = 'Name'] !=''">
<strong><xsl:value-of select="Field[@Name='Name']" /></strong><br />
</xsl:if>
<xsl:if test="Field[@Name = 'StreetandNumber'] !=''">
<xsl:value-of select="Field[@Name='StreetandNumber']" /><br />
</xsl:if>
<xsl:if test="not(Field[@Name='City'] = '')">
<xsl:value-of select="Field[@Name='Postal']" /> <xsl:value-of select="Field[@Name='City']" />
</xsl:if><br />
<xsl:if test="Field[@Name = 'Phone'] !=''">
Tel: <xsl:value-of select="Field[@Name='Phone']" disable-output-escaping="yes" /><br />
</xsl:if>
<xsl:if test="Field[@Name = 'Fax'] !=''">
Fax: <xsl:value-of select="Field[@Name='Fax']" disable-output-escaping="yes" /><br />
</xsl:if>
<xsl:if test="Field[@Name = 'Email'] !=''">
<a><xsl:attribute name="href">mailto:<xsl:value-of select="Field[@Name='Email']" disable-output-escaping="yes" /></xsl:attribute><xsl:value-of select="Field[@Name='Email']" disable-output-escaping="yes" /></a><br />
</xsl:if>
<xsl:if test="Field[@Name = 'Website01'] !=''">
<xsl:value-of disable-output-escaping="yes" select="Field[@Name='Website01']/Output"/><br />
</xsl:if>
</div>
<hr />
</xsl:if>
</xsl:for-each>
</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"/>