This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Finding the maximum number of nodes (Redux)
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Finding the maximum number of nodes (Redux)
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Wed, 3 Oct 2001 16:35:29 +0200
- References: <59B292A4FEF3D411A10600508B6F27B20305647F@clttmp21.ncmi.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> <xsl:attribute name="colspan"><xsl:value-of select="count(tr[count(td)
>
> count(following-sibling::tr[count(td) >
> count(preceding-sibling::tr[last()]/td)]/td)][count(td) >
> count(preceding-sibling::tr[last()]/td)]/td)"/></xsl:attribute>
This would be unacceptable for me - who should understand that later?
Why not something like that:
<xsl:template match="table">
<xsl:variable name="cols">
<xsl:for-each select="tr">
<xsl:sort select="count(td)"/>
<xsl:if test="position()=last()">
<xsl:value-of select="count(td)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<table border="1">
<tr>
<td colspan="{$cols}">Table Header Text</td>
</tr>
<xsl:copy-of select="tr"/>
</table>
</xsl:template>
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list