re dynamic drop down

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • timothy ma and constance lee

    #1

    re dynamic drop down

    I try to generate the drop down using

    <xsl:template name="generateD ropdown">

    <xsl:param name="length" />

    <xsl:if test="$length &gt; 0">

    <option value="{$length }"><xsl:valu e-of

    select="$length " /></option>

    <xsl:call-template name="generateD ropdown">

    <xsl:with-param name="length" select="$length -

    1"/>

    </xsl:call-template>

    </xsl:if>

    </xsl:template>



    Can I generate it from ascending order?


  • Joris Gillis

    #2
    Re: re dynamic drop down

    [color=blue]
    > Can I generate it from ascending order?[/color]


    use this:

    <xsl:template name="generateD ropdown">
    <xsl:param name="length" />
    <xsl:param name="count" select="$length "/>
    <xsl:if test="$length &gt; 0">
    <option value="{$count - $length + 1}"><xsl:valu e-of select="$count - $length +1" /></option>
    <xsl:call-template name="generateD ropdown">
    <xsl:with-param name="length" select="$length -1"/>
    <xsl:with-param name="count" select="$count"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>



    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
    Ceterum censeo XML omnibus esse utendum

    Comment

    Working...