Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Loop thru nodes and build table [Thread Next] Re: Loop thru nodes and build tableTo: NULL Date: 10/2/2007 4:22:00 PM
Praveen wrote:
> Want to print a table from the above data.
> How to do this in xsl.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:param name="column-count" select="2" />
<xsl:template match="R">
<table>
<xsl:apply-templates select="I[position() mod $column-count = 1]"
mode="row" />
</table>
</xsl:template>
<xsl:template match="I" mode="row">
<tr>
<xsl:apply-templates select=". | following-sibling::I[position()
< $column-count]" mode="column" />
</tr>
</xsl:template>
<xsl:template match="I" mode="column">
<td>
<xsl:value-of select="@N" />
</td>
</xsl:template>
</xsl:stylesheet>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
