xslt problem help!

Joined
Jul 21, 2004
Messages
57
Reaction score
0
Sir

I am using the recursive template to generate the dynamic drop down list as below:

<xsl:template name="generateDropdown">
<xsl:param name="length" />
<xsl:param name="refrid" />
<xsl:param name="count" select="$length"/>

<xsl:if test="$length > 0">
<option value="{$refrid}|{$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:with-param name="refrid" select="$refrid"/> </xsl:call-template> </xsl:if> </xsl:template>

The value will be ascending order from 1 to length. However, is it possible to add the blank line like option value <option value=""></option> so that the toppest list is blank value first and then 1 and so on
 

Joris Gillis

Usenet Archive
Joined
Sep 28, 2004
Messages
355
Reaction score
0
However, is it possible
to add the blank line like option value
<option value=""></option> so that the toppest list is blank value first and then 1 and so on

Hi,

just add
<xsl:template name="generateDropdown">
<xsl:param name="length" />
<xsl:param name="refrid" />
<xsl:param name="count" select="$length"/>

<xsl:if test="$length &gt; 0">
<option value="{$refrid}|{$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:with-param name="refrid" select="$refrid"/> </xsl:call-template> </xsl:if> </xsl:template>

regards,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top