xsl-list
[Top] [All Lists]

Re: Limiting XSL Results for Timely Web Page Display

2002-11-19 18:24:27
Pass a parameter to the XSL and use this for transformation:

<xsl:param name="start" select="0"/>
<xsl:param name="count" select="20"/>

<xsl:template match="result">
<xsl:apply-templates select="entries[position() > $start][position() &lt; $count + 1]"/>
</xsl:template>

The select attribute of <xsl:param/> stores a default value, if no value is passed to the XSL. If the user clicks on a link "next 20 results", the "20" must be passed to the XSL again. Is this conceivable?

Regards,

Joerg

Bruce Dailey wrote:
I am building a search engine with ASP and XSL. One of the user’s
requirements is to limit the output to 20 items at a time. The search
engine searches an XML file and creates HTML on the server that is then
displayed in the user’s browser of the search results.
One alternative is to have XSL parse everything and then have ASP divide
the results into 20 item segments. Well I know this is not the best
solution, but as a XSL newbie, it is easier to comprehend, but at the
same time it does not have the precision of having XSL return a set of
20 items. Any recommendations? Don’t worry about patronizing me with a Mickey
Mouse explanation – I need one!


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list