Subject: Re: XSL: Build a dynamic HTML Select from a single Quantity value
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 7 Aug 2008 17:10:33 +0100
|
> I am somewhat new to writing style sheets but I am experienced in ASP / VBscript where I would handle this with a For / Next like:
> <select name="Quantity">
> <% For count = 1 to Quantity
> response.write("<option value='" & count & "'>" & count & "</option>")
> Next %>
> </select>
As you are using XSLT 2.0 you can just do:
<xsl:for-each select="1 to Quantity">
<option value="{.}">
<xsl:value-of select="."/>
..
:)
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
|