[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Identity Transform Grouping Question

Subject: Re: Identity Transform Grouping Question
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Sat, 06 Nov 2004 12:34:20 +0100
Re:  Identity Transform Grouping Question
ethan.kalfus@xxxxxxx wrote:

<xsl:key name="offices" match="office" use="concat(cities/city[@lang='en'],'-',names/name[@lang='en'])"/>


	<!-- reorganize 'country' elements -->
	<xsl:template match="country">
			<xsl:copy-of select="@*"/>
				<!-- 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: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']"/>

Hi Ethan,

Why use the node-set function here if you could use a key as well?

<xsl:key name="offices-by-country" match="office" use="ancestor::country/@name"/>

Or am I missing something?


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.