Re: [xsl] Top n values

Subject: Re: [xsl] Top n values
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Fri, 18 Oct 2002 09:23:43 +0000
..continued from previous mail..
you can also do without node-set()..
<xsl:for-each select="/root/item">
<xsl:sort select="." order="descending" data-type="number"/>
<xsl:if test="position()&lt;=3">
<xsl:value-of select="."/><br/>

From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Top n values
Date: Thu, 17 Oct 2002 12:30:04 -0700 (PDT)

I need to process the top n values in a list where n
is dynamic. So if n=3 and I had the following XML:


I need to process <item>'s with values 6,5,4. If I had
captured n in a variable/parameter, what is the most
efficient way to do this? What I want to avoid is walking
the <item> nodset multiple times as there are a lot of
<item>s (thousands). Thanks.

XSL-List info and archive:

Get faster connections -- switch to MSN Internet Access!

XSL-List info and archive:

Current Thread