This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Finding the maximun number of nodes
- To: mlee at kanhan dot com
- Subject: Re: [xsl] Finding the maximun number of nodes
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Fri, 5 Jan 2001 00:18:37 -0800 (PST)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Michael Lee wrote:
> Therefore, I must be able to determine the maximum number of
> cells in the rows and use it as the value for the "columns"
attribute.
Use:
<xsl:key name="numCells" match="tr" use="count(td)"/>
<xsl:template name="maxCols">
<xsl:for-each select="//tr[not(key('numCells', count(td) + 1))]">
<xsl:value-of select="count(td)"/>
</xsl:for-each>
</xsl:template>
Cheers,
Dimitre.
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list