[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Iteration in 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 > 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
|
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
|