Subject: Re: [xsl] Running through a subset of elements based on index From: Adam Nielsen <adam.nielsen@xxxxxxxxx> Date: Fri, 11 Apr 2008 17:24:45 +1000 |
are you using xslt 2 or 1
In xslt 1 if you want to to much "processing" at the same time as grouping it's almost always easier to do it in two passes, first use the muenchian grouping, as you have it, to remove duplicates and sort, but don't process each group, then (by using a second stylesheet or a x:node-set() extension process the sorted nodes. As described the processing os probably simple enough to do it in one pass, but it's on the edge and if it gets any more complicated definitely doing it in two passes is easier and more maintanable.
If on the other hand you're using xslt2 this kind of processing is made much easier with xsl:for-each-group.
<xsl:for-each select="$aAllYears"> <xsl:sort select="." /> <xsl:if test="position() < 5"> Year: <xsl:value-of select="."/><br/> </xsl:if> </xsl:for-each>
Cheers, Adam.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Running through a subset , David Carlisle | Thread | Re: [xsl] Running through a subset , John Snelson |
Re: [xsl] An (almost) identity styl, bryan rasmussen | Date | [xsl] [XSLT]Use value of parameter, IZASKUN GUTIERREZ GU |
Month |