This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: newbie qtn: best way to display a specific range of records (say, 5-10, or whatever)
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] newbie qtn: best way to display a specific range of records (say, 5-10, or whatever)
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 19 Sep 2001 15:28:04 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Ideally what I want to do is something like this:
>
> <xsl:for-each select="//data/job" startwith="//params/startrecord"
> numrecords="//params/numrecords">
You want
<xsl:variable name="start" select="number(//params/startrecord)"/>
<xsl:variable name="count" select="number(//params/numrecords)"/>
<xsl:for-each select="//data/job[position() >= $start and position() <
$start+$count]">
> I'd like to avoid
> the method of iterating over all records, and simply not
> displaying those outside the range.
>
Then you'll have to find a rather clever XSLT processor.
If you're going to process the same source document repeatedly then you
might find some way of building an index using <xsl:key> that avoids the
serial scan, but I suspect you're going to have to live with it.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list