xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOZLOV Roman <r-koz...@opencascade.com>
Subject Re: nr of results && starting position
Date Wed, 19 Jun 2002 11:18:03 GMT
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() &lt; $lastpos) and
(position() &gt; $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:jgreif@alumni.princeton.edu]
>      Sent: Tuesday, June 18, 2002 22:24
>      To: xindice-users@xml.apache.org; prive@de-schepper.be
>      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:develop@de-schepper.be
>           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/myitem[@timestamp='20020514124420645']"but
>           this will return only that one elementGuy
>


Mime
View raw message