I am trying to transform a bit of xml which represents an image gallery into an html table. (it must be done with html and not with css). How do I add the row break </tr><tr>
every six or so columns with xsl?
I have this:
<xsl:for-each select="//email/gallery" >
<td><img>
<xsl:attribute name="src">
<xsl:value-of select="gallery-image-location"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="gallery-image-alt"/>
</xsl:attribute>
</img></td>
<xsl:if test="????">
</tr><tr>
</xsl:if>
<xsl:for-each>
In Javascript I would do something like:
for (i=0; i<gallery.length; i++) {
htm += '<td><img src="' +
gallery[i].gallery-image-location +
'" alt="'+ gallery[i].gallery-image-alt +'"></td>';
if (i%6 == 5 && i != gallery.length-1) {
htm += '</tr><tr>';
}
}