[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sorting using a precalculated value
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|