• xslt实现自增长


    number.xml:
    
    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="number.xsl" ?>
    <root>
           <start>6</start>
    </root>
    number.xsl:
    
    <?xml version="1.0" encoding="utf-8" ?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
     
    <xsl:param name="beg" select="root/start"/><!--起始值,这里取自XML,也可直接在此设定-->
    <xsl:param name="end" select="31"/><!--最大值,最后输出结果由起始值和步长值共同决定,并非一定是最大值,但不会大于最大值-->
    <xsl:param name="step" select="3"/><!--步长值-->
     
    <xsl:template match="/">
           <xsl:call-template name="numtemplate">
                  <xsl:with-param name="number" select="0"/>
           </xsl:call-template>
    </xsl:template>
     
    <xsl:template name="numtemplate">
           <xsl:param name="number"/>
           <xsl:if test="not($number &gt; ($end - $beg))">
                  <xsl:value-of select="$beg + $number"/><br/>
                  <xsl:call-template name="numtemplate">
                         <xsl:with-param name="number" select="$number + $step"/>
                  </xsl:call-template>
           </xsl:if>
    </xsl:template>
     
    </xsl:stylesheet>
  • 相关阅读:
    Spring Aop实例之xml配置
    Spring execution 表达式
    JVM调优总结 -Xms -Xmx -Xmn -Xss
    springmvc整合redis架构搭建实例
    mysql权限操作(转)
    mybatis动态排序
    spring mvc重定向
    jquery中bind和on的区别
    在java项目中使用umeditor
    mybatis的基础Dao
  • 原文地址:https://www.cnblogs.com/kingge/p/2701178.html
Copyright © 2020-2023  润新知