XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog
XSLT的精髓是递归。

<xsl:template name="loopI">
    <xsl:param name="i" select="1" />

    <xsl:call-template name="loopJ">
         <xsl:with-param name="j" select="1" />
    </xsl:call-template>

    <!-- enter next i if i<=10 -->
    <xsl:if test="$i &lt; 11>
        <xsl:call-template name="loopI">
             <xsl:with-param name="i" select="$i + 1" />
        </xsl:call-template>
    </xsl:if>
</xsl:template>

<xsl:template name="loopJ">
    <xsl:param name="j" select="1" />

    <!-- do you job here -->


    <!-- enter next i if i<=5-->
    <xsl:if test="$j &lt; 6
        <xsl:call-template name="loopJ">
             <xsl:with-param name="j" select="$j + 1" />
        </xsl:call-template>
    </xsl:if>
</xsl:template>

 

posted on 2019-11-12 09:39  不及格的程序员-八神  阅读(34)  评论(0编辑  收藏  举报