圣诞快乐。。CSDN的兄弟姐妹们!请问xsl中变量循环递增怎么做?
如题,看了孟子老师的"在XSL里执行类似for(i=0;i<n;i++)的循环"愣是没看懂。。。汗~~
请高人帮着改一下。。偶XML菜菜!!! :(
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="//item"/>
</xsl:template>
<xsl:template match="item">
<xsl:element name="card">
<xsl:attribute name="id"><!--这里是要循环递增的变量level--></xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:value-of select="title" />
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>