This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sorting using a precalculated value
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] sorting using a precalculated value
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 28 Mar 2001 17:11:23 +0100
- References: <9B3E950CB293D411ADF4009027B0A4D2E9D184@maileu.imediation.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I was ready to build a temporary tree but was wondering if I there was a
> cleaner solution.
looking at your example code it looks like you are trying to build a
sort key that is just the concatenation of the name attributes
from ancestor class elements.
Isn't sorting on such a concatenation would seem the same as
sorting at each level of the tree separately.
then you could use a sort key of @name.
so instead of
<xsl:for-each select=".//class">
do
<xsl:apply templates select="class">
<xsl:sort select="@name"/>
</xsl:apply-templates>
together with something like
<xsl:template match="class">
do whatever you want to do for this class, then do its children
<xsl:apply templates select="class">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</xsl:template>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list