[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Transform min and max values to list?

Subject: Re: Transform min and max values to list?
From: Ronald <ronald@xxxxxxxxxxx>
Date: Thu, 19 Apr 2001 09:51:01 +0100
min count in xsl
Maybe you could try 2 construct a loop:

<xsl:call-template name="for.loop">
        <xsl:with-param name="i">1</xsl:with-param>
        <xsl:with-param name="count">10</xsl:with-param>
</xsl:call-template>


<xsl:template name="for.loop"> <xsl:param name="i"/> <xsl:param name="count"/> <xsl:if test="$i &lt;= $count"> <!-- body of the loop goes here --> </xsl:if> <xsl:if test="$i &lt;= $count"> <xsl:call-template name="for.loop">

                        <xsl:with-param name="i">
                                <!-- Increment index-->
                                <xsl:value-of select="$i + 1"/>
                        </xsl:with-param>
                        <xsl:with-param name="count">
                                <xsl:value-of select="$count"/>
                        </xsl:with-param>
                </xsl:call-template>
        </xsl:if>
</xsl:template>
(code-bit in XML cooktop!)


ronald


At 05:41 PM 4/19/01 +1000, you wrote:
I want to transform this element:

<number min="1" max="3"/>

into this:

<select>
  <option>1</option>
  <option>2</option>
  <option>3</option>
</select>

I have looked at for-each but its select attribute requires a node-set. Is
there a simple way to achieve what I want?

Thanks in advance.

--
Michael Strasser
Brisbane, Australia

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.