[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: getting the longest text node
I just thought I'd provide a variation. I can't make any performance
claims vs. a sort in a for-each. Maybe someone else knows.
<xsl:template match="/"> <xsl:apply-templates select="//orange"> <xsl:sort data-type="number" order="descending" select="string-length(.)"/> </xsl:apply-templates> </xsl:template> <xsl:template match="orange"> <xsl:if test="position()=1"> <LongString type="{name()}" string-length="{string-length(.)}"> <xsl:value-of select="."/> </LongString> </xsl:if> </xsl:template> -rick At 10:35 PM 3/11/03 +0100, you wrote: hi!
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|