RE: Disable Output Escaping - really useful

Subject: RE: Disable Output Escaping - really useful
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 22 Mar 2000 12:54:37 -0000

> -----Original Message-----
>>In the template for loosegrids below, 5 items are put in each row. 
> When an item is the 5th, 10th, 15th etc. (using "position() mod 5 =0") it 
> should close this row and start the next
> Anyone know a way of doing this without 
> disable-output-escaping? Is using
> disable-output-escaping like this a bit of a hack?
> 
Yes, it's a horrible hack. I posted the following solution a while back:

<xsl:for-each select="item[position() mod 5 = 0]
<tr>
<td><xsl:value-of select="."/></td>
<td><xsl:value-of select="following-sibling::item[1]"/></td>
<td><xsl:value-of select="following-sibling::item[2]"/></td>
<td><xsl:value-of select="following-sibling::item[3]"/></td>
<td><xsl:value-of select="following-sibling::item[4]"/></td>
</tr>
</xsl:for-each>

There are other solutions involving recursive templates.

Mike Kay


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


Current Thread