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

Re: Iteration in XSL

Subject: Re: Iteration in XSL
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Mon, 17 Jan 2000 17:14:46 +0100
recursivity xsl
You need to use recursivity.

For example :


---------- XML file : ----------
<?xml version='1.0' encoding='ISO-8859-1'?>

<index>4</index>
---------- XSL file : ----------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="index" name="index">
<xsl:param name="idx" select="normalize-space()"/>
<td>
<xsl:if test="$idx &gt; 0">
<xsl:call-template name="index">
<xsl:with-param name="idx" select="$idx - 1"/>
</xsl:call-template>
</xsl:if>
</td>
</xsl:template>


</xsl:stylesheet>
---------- result : ----------
<?xml version="1.0" encoding="utf-8"?>
<td><td><td><td><td/></td></td></td></td>
------------------------------

Hope this helps.

Eric

Martin Kupisch wrote:
> 
> Hi everyone,
> 
> currently I am working on connecting an XML-file with an XSL-file via
> LotusXSL to get an HTML-file. So far, so good. My problem is: in the
> HTML-file there is a table that needs conditional processing. Depending on
> an specific element value, e.g. <level>4</level>, I need to get table cells,
> <TD>. I.e., the value is 4, I would like to have 4 times <TD> in the result
> tree. So, as I cannot find a way of iteration in XSL, I would like to know
> if there is any chance of getting this achieved. Thanks for any suggestions
> !!
> Martin
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
------------------------------------------------------------------------
Eric van der Vlist                                              Dyomedea

http://www.dyomedea.com                          http://www.ducotede.com
------------------------------------------------------------------------


 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.