|
Subject: Re: [xsl] Identity Transform Grouping Question From: Geert Josten <Geert.Josten@xxxxxxxxxxx> Date: Sat, 06 Nov 2004 12:34:20 +0100 |
<xsl:key name="offices" match="office" use="concat(cities/city[@lang='en'],'-',names/name[@lang='en'])"/>
<!-- reorganize 'country' elements -->
<xsl:template match="country">
<country>
<xsl:copy-of select="@*"/>
<cities>
<!-- group 'city' elements within this country -->
<xsl:variable name="offices-in-this-country">
<xsl:copy-of select="offices"/>
<!-- this is a trick, to restrict all subsequent key usage to this country only -->
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($offices-in-this-country)/offices/office/cities[count(.|key('cities',city[@lang='en'])[1])=1]">
<xsl:sort select="city[@lang='en']"/>
</xsl:apply-templates>
</cities>
</country>
</xsl:template>
Grtz, Geert
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Identity Transform Groupi, ethan.kalfus | Thread | Re: [xsl] Identity Transform Groupi, Geert Josten |
| Re: [xsl] Help needed to make XSL f, Geert Josten | Date | RE: [xsl] Netscape7 and embedded ja, Bryan Rasmussen |
| Month |