|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: finite loop, incrementing, or...?
> <tscmeta>
> <frequency code="ANNUAL" />
> <date year="1994" month="1" day="1" />
> <date year="1998" month="12" day="31" />
> </tscmeta>
>
> Desired output:
> <table><tr><td>1994</td><td>1995</td><td>1996</td><td>1997</td
> ><td>1998</td>
> </tr></table>
>
> Any solutions?
There's a nice little extension function coming out in the next Saxon
release that will allow you to do
<table><tr>
<xsl:for-each select="s:range(date[1]/@year, date[2]/@year)">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr></table>
Meanwhile it has to be recursion. The principle is:
template do-range
param from
param to
if $from<=$to
<td><value-of $from></td>
call-template do-range
with-param from = $from+1
with-param to = $to
/call
/if
/template
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








