[Home] [By Thread] [By Date] [Recent Entries]
On 12/12/06, David Carlisle <davidc@xxxxxxxxx> wrote:
The following will handle any number of rows: David, I took your code and modified it just a little to what I am really doing and it is only giving me one column tables: XML: <detailNVPSet> <detailNVP name="a">1</detailNVP> <detailNVP name="b">2</detailNVP> <detailNVP name="c">3</detailNVP> <detailNVP name="d">4</detailNVP> <detailNVP name="e">5</detailNVP> <detailNVP name="f">6</detailNVP> <detailNVP name="g">7</detailNVP> <detailNVP name="h">8</detailNVP> <detailNVP name="i">9</detailNVP> <detailNVP name="j">10</detailNVP> </detailNVPSet> XSLT:
<xsl:template match="detailNVPSet">
<table>
<xsl:for-each select="detailNVP[position() mod 5 =1]">
<xsl:text> </xsl:text>
<tr>
<xsl:for-each select=".|following-sibling::node[position() < 5]">
<td><xsl:value-of select="concat(@name,':',.)"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
<xsl:text> </xsl:text>
</table>
</xsl:template>Output:
<table>
<tr>
<td>a:1</td>
</tr>
<tr>
<td>f:6</td>
</tr>
</table>
|

Cart



