Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   re dynamic drop down (http://www.velocityreviews.com/forums/t168032-re-dynamic-drop-down.html)

timothy ma and constance lee 10-19-2004 04:32 AM

re dynamic drop down
 
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?



Joris Gillis 10-19-2004 05:06 PM

Re: re dynamic drop down
 

> 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-v...i?userid=38041)
Ceterum censeo XML omnibus esse utendum


All times are GMT. The time now is 05:33 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.