Sorry again, of course it should be the following:
<xsl:template match="/">
<xsl:apply-templates select="item" mode="base">
</xsl:template>
<xsl:template match="item" mode="base">
<xsl:if test="self::node()[EMAIL PROTECTED]'theFirst']">
<xsl:variable name="pos" select="position()"/>
<xsl:variable name="lastpos" select="number($pos) + 100"/>
<xsl:apply-templates select="item[((position() < $lastpos) and
(position() > $pos)) or (position() = $pos) ]" mode="iteration"/>
</xsl:if>
</xsl:template>
<xsl:template match="item" mode="iteration">
. . .
</xsl:template>
Roman
KOZLOV Roman wrote:
> Sorry, I've forgot the initial question conditions (identify item by some
> attribute):
>
> <xsl:template match="/">
> <xsl:apply-templates select="[EMAIL PROTECTED]'theFirst']" mode="base">
> <xsl:with-param name="pos" select="39"/>
> </xsl:applyl-templates>
> </xsl:template>
>
> <xsl:template match="item" mode="base">
> <xsl:param name="pos"/>
> <xsl:variable name="lastpos" select="number($pos) + 100"/>
> <xsl:apply-templates select="item[((position() < $lastpos) and
> (position() > $pos)) or (position() = $pos) ]" mode="iteration"/>
> </xsl:template>
>
> <xsl:template match="item" mode="iteration">
> . . .
> </xsl:template>
>
> KOZLOV Roman wrote:
>
> > Try the following construction:
> >
> > <xsl:template match="/">
> > <xsl:call-template name="base">
> > <xsl:with-param name="pos" select="39"/>
> > </xsl:call-template>
> > </xsl:template>
> >
> > <xsl:template name="base">
> > <xsl:param name="pos"/>
> > <xsl:variable name="lastpos" select="number($pos) + 100"/>
> > <xsl:apply-templates select="item[((position() < $lastpos) and
> > (position() > $pos)) or (position() = $pos) ]" mode="iteration"/>
> > </xsl:template>
> >
> > <xsl:template match="item" mode="iteration">
> > . . .
> > </xsl:template>
> >
> > Best regards,
> > Roman
> >
> > Guy De Schepper wrote:
> >
> > > ok, this query will indeed do the job for this example, but what about
> > > large documents / collections ?let's say the document contains 10000
> > > items and I want to display them with 100 at a time.for each page
> > > (which will contain 100 items) I have to launch 100 queries !
> > >
> > > -----Original Message-----
> > > From: Jeff Greif [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, June 18, 2002 22:24
> > > To: [email protected]; [EMAIL PROTECTED]
> > > Subject: Re: nr of results && starting position
> > > You would need to use the preceding-sibling construct of
> > > XPath. To get three items starting with the one with a
> > > partiicular timestamp, you would return /mydoc/myitem
> > > elements such that the timestamp of the context node, or its
> > > preceding sibling, or the preceding sibling of its preceding
> > > sibling was as specified. Jeff
> > >
> > > From:[EMAIL PROTECTED]
> > > To: Xindice-Users
> > > Sent: Tuesday, June 18, 2002 5:35 AM
> > > Subject: nr of results && starting position
> > > ...Now, I want to query this document for the next
> > > 2 items, starting with item which
> > > timestamp='20020514124420645'the query I am
> > > thinking of is something like this:xindice xpath
> > > -c /db/mytestcol -q
> > > "/mydoc/[EMAIL PROTECTED]'20020514124420645']"but
> > > this will return only that one elementGuy
> > >
begin:vcard
n:KOZLOV;Roman
tel;work:+783 12 65 85 91, +783 12 62 27 76
x-mozilla-html:FALSE
org:DATAVISION CIS;PDM
adr:;;Gagarina Prospect 25b;Nizhny Novgorod;;;RUSSIA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Programmer
fn:Roman KOZLOV
end:vcard