经典ASP和xsl xsl:for-each设置from和to值

时间:2013-10-07 15:01:44

标签: xml xslt asp-classic pagination

目前我有以下代码列出最近12篇文章:

    <xsl:for-each select="rss/channel/item[position() &lt;= 12]">

我想要的是类似于分页效果。有没有办法让之间有:

    <xsl:for-each select="rss/channel/item[position() &gt;= 12 & &lt;= 24]">

我会传递我的asp页面中的值:

  mm_xsl.addParameter "from",
  mm_xsl.addParameter "to"

然后在我的xsl页面中:

    <xsl:for-each select="rss/channel/item[position() &gt;= $from & &lt;= $to]">

这可能吗?

1 个答案:

答案 0 :(得分:1)

是的,有可能。你几乎拥有正确的谓词,你只需要在其中加入正确的语法。您将其更新为以下内容:

<xsl:for-each select="rss/channel/item[position() &gt;= $from and position() &lt;= $to]">

这样可以为您的所有物品提供两个变量之间的位置。