This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: to extract the longest string (fwd)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]