繁体   English   中英

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

[英]Classic ASP and xsl xsl:for-each setting a from and to value

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

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

我想要的是类似于分页效果。 有没有一种方法可以使as为:

    <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]">

这可能吗?

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

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

这将使您所有项目的位置都在两个变量之间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM