This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: changing table column to row
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: changing table column to row
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Mon, 7 Feb 2000 13:05:56 -0000
- Reply-To: xsl-list at mulberrytech dot com
> i have a xml file with data in columns,
> Is there an easy (and efficient) way to change this into the
> html row model.
<xsl:template name="one-row">
<xsl:param name="row-num" select="1">
<tr>
<xsl:for-each select="column">
<td><value-of select="*[$row-num]"></td>
</xsl:for-each>
</tr>
<xsl:if test="column/*[$row-num+1]">
<xsl:call-template name="one-row"/>
<xsl:with-param name="row-num" select="$row-num+1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Needs a little more care if the columns could be different lengths.
MHK
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list