This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: to extract the longest string (fwd)
- To: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Subject: Re: to extract the longest string (fwd)
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Fri, 18 Aug 2000 10:53:18 +0100
- Cc: xsl-list at mulberrytech dot com
- Reply-To: xsl-list at mulberrytech dot com
Rajagopal,
Oliver Becker wrote:
>The following works similar to a solution recently posted by Jeni:
>
><xsl:template match="table">
> <xsl:for-each select="row">
> <xsl:sort select="count(col)"
> data-type="number" order="descending" />
> <xsl:if test="position()=1">
> <xsl:for-each select="col">
> <xsl:value-of select="@align" />
> </xsl:for-each>
> </xsl:if>
> </xsl:for-each>
></xsl:template>
Yes, sorry - I overlooked the data-type="number" from the sort, which means
that something with 10 cols would be counted as shorter than something with
9 cols.
Cheers,
Jeni
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list