re dynamic drop down

Discussion in 'XML' started by timothy ma and constance lee, Oct 19, 2004.

  1. I try to generate the drop down using

    <xsl:template name="generateDropdown">

    <xsl:param name="length" />

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

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

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

    <xsl:call-template name="generateDropdown">

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

    1"/>

    </xsl:call-template>

    </xsl:if>

    </xsl:template>



    Can I generate it from ascending order?
    timothy ma and constance lee, Oct 19, 2004
    #1
    1. Advertising

  2. timothy ma and constance lee

    Joris Gillis Guest


    > Can I generate it from ascending order?



    use this:

    <xsl:template name="generateDropdown">
    <xsl:param name="length" />
    <xsl:param name="count" select="$length"/>
    <xsl:if test="$length &gt; 0">
    <option value="{$count - $length + 1}"><xsl:value-of select="$count - $length +1" /></option>
    <xsl:call-template name="generateDropdown">
    <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-view.cgi?userid=38041)
    Ceterum censeo XML omnibus esse utendum
    Joris Gillis, Oct 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    756
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,012
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    472
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    267
  5. Replies:
    3
    Views:
    285
Loading...

Share This Page