[xsl] Trouble creating tables while looping through elements

Subject: [xsl] Trouble creating tables while looping through elements
From: Charles-Louis De Maere <charles-louis.demaere@xxxxxxxxxxxxxxx>
Date: Mon, 10 May 2010 10:13:52 +0200
Dear all,

I'm looping through a (sorted) list of nodes, and would like to put them in different tables based on a certain condition using xslt.

At the moment, I'm doing the following :

<table>
<xsl:for-each select="node">
<tbody>
        ... some formatting ...
</tbody>
<xsl:if test="not(subnode = following-sibling::node/subnode)">
</table>
<h2>Some Title</h2>
<table>
</xsl-if>
</xsl:for-each>
</table>

However, this XSLT file is invalid (XMLSpy indicates a warning when I save it, because of the closing <table> tag underneath the if-test), and Firefox refuses to display it for the same reason.

Is there any easy way to have some kind of separation within the for-each loop, or should I take this formatting out of the loop ?


Thanks in advance,


Charles-Louis de Maere

Current Thread