请教:如何使用XSL对XML的节点值进行数学运算,并输出结果???

大家好:

小弟编写一个翻页程序,用XML+XSL实现。在显示“上一页”或“下一页”的时候出了问题:
如何将得到的当前页数值加一或减一,应该怎么写呢?

谢谢!
我的引用为:

1<a><xsl:attribute name="href">list.php?page=<xsl:value-of select="/lists/currentpage"></xsl:value-of></xsl:attribute>下一页</a>

---------------------------------------------------------------

if you are using XSLT, try

1<a><xsl:attribute name="href">list.php?page=<xsl:value-of select="number(/lists/currentpage) + 1"></xsl:value-of></xsl:attribute>下一页</a>

or

1<a href="list.php?page={number(/lists/currentpage) + 1}">下一页</a>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus