function for() in xslt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sakurasyi
    New Member
    • May 2006
    • 31

    #1

    function for() in xslt

    hi there...

    i need your help, please..
    did anyone know how to use funtion "for(int i = 0; i< 10; i++)" in java script in xslt?
    what i know, we can't use some symbols such as < and > in xml or xsl. thus, did anyone know how to use the "for(...)" function?
  • sur97c
    New Member
    • Nov 2007
    • 1

    #2
    Originally posted by sakurasyi
    hi there...

    i need your help, please..
    did anyone know how to use funtion "for(int i = 0; i< 10; i++)" in java script in xslt?
    what i know, we can't use some symbols such as < and > in xml or xsl. thus, did anyone know how to use the "for(...)" function?

    hi!!!

    you can, use next code:

    <xsl:call-template name="test">
    <xsl:with-param name="count" select="10"/>
    </xsl:call-template>
    <xsl:template name="test">
    <xsl:param name="count" select="1"/>
    <xsl:if test="$count > 0">
    <xsl:value-of select ="$count"/>
    <xsl:call-template name="test">
    <xsl:with-param name="count" select="$count - 1"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>

    Comment

    Working...