This is a re-post of my question. The original question was posted here... thread426-188079 there has been no response and I'm still stuck. Would very much appreciate it if someone could lend me a hand on this.
Given a stream of Y data elements, how can I arrange that data into an HTML table of X columns? The problem I am having is figuring out how to properly insert the <TR> and </TR> tags into the output given that the number of elements in the XML data source and the column width of the table are both variable.
Can anyone lend me a hand on this?
The following will construct the cells into a continuous series of columns, but does nothing to break them up into rows. That's the part I can't figure out.
<Data>
<NumColumns value="8"/>
<ImgURI value="something"/>
<ImgURI value="something-else"/>
<ImgURI value="another-one"/>
<ImgURI value="..."/>
</Data>
<xsl:template match="/">
<table>
<xsl:for-each select="/Data/ImgURI">
<xsl:call-template name="table-cell"/>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template name="table-cell">
<td>
<img><xsl:attribute name="src"><xsl:value-of
select="@value"/></xsl:attribute>
</img>
</td>
</xsl:template>
Given a stream of Y data elements, how can I arrange that data into an HTML table of X columns? The problem I am having is figuring out how to properly insert the <TR> and </TR> tags into the output given that the number of elements in the XML data source and the column width of the table are both variable.
Can anyone lend me a hand on this?
The following will construct the cells into a continuous series of columns, but does nothing to break them up into rows. That's the part I can't figure out.
<Data>
<NumColumns value="8"/>
<ImgURI value="something"/>
<ImgURI value="something-else"/>
<ImgURI value="another-one"/>
<ImgURI value="..."/>
</Data>
<xsl:template match="/">
<table>
<xsl:for-each select="/Data/ImgURI">
<xsl:call-template name="table-cell"/>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template name="table-cell">
<td>
<img><xsl:attribute name="src"><xsl:value-of
select="@value"/></xsl:attribute>
</img>
</td>
</xsl:template>