This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: exit <xsl:for-each> or change <xsl:variable>
- From: Matts Isuls <matts dot isuls at AGROLINK dot FI>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 2 Apr 2002 11:43:15 +0300
- Subject: Re: [xsl] exit <xsl:for-each> or change <xsl:variable>
- Reply-to: xsl-list at lists dot mulberrytech dot com
ok,
Here is the actual problem. If the processor comes across a $next-table$
cell it should:
<xsl:if test="(cell[1]/data)='$next-table$'">
</table><table border="1">
</xsl:if>
but that is not possible is it. Is there a way to do this? I would like to
end the current table and start a new one when the value '$next-table$'
shows up.
Matts Isuls
-------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<table border="1">
<xsl:for-each select="/root/table/row">
<xsl:if test="(cell[1]/data)='$next-table$'">
<!-- </table><table border="1"> -->
</xsl:if>
<tr>
<xsl:for-each select="cell">
<td>
<xsl:value-of select="data"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</html>
</xsl:template>
</xsl:stylesheet>
-------------------
-------------------
<?xml version="1.0"?>
<root>
<table>
<row>
<cell><data>r1c1</data></cell>
<cell><data>r1c2</data></cell>
<cell><data>r1c3</data></cell>
<cell><data>r1c4</data></cell>
</row>
<row>
<cell><data>r2c1</data></cell>
<cell><data>r2c2</data></cell>
<cell><data>r2c3</data></cell>
<cell><data>r2c4</data></cell>
</row>
<row>
<cell><data>r3c1</data></cell>
<cell><data>r3c2</data></cell>
<cell><data>r3c3</data></cell>
<cell><data>r3c4</data></cell>
</row>
<row>
<cell><data>$next-table$</data></cell>
<cell><data></data></cell>
<cell><data></data></cell>
<cell><data></data></cell>
</row>
<row>
<cell><data>r1c1</data></cell>
<cell><data>r1c2</data></cell>
<cell><data>r1c3</data></cell>
<cell><data>r1c4</data></cell>
<cell><data>r1c5</data></cell>
</row>
<row>
<cell><data>r2c1</data></cell>
<cell><data>r2c2</data></cell>
<cell><data>r2c3</data></cell>
<cell><data>r2c4</data></cell>
<cell><data>r2c5</data></cell>
</row>
</table>
</root>
-------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list