| Subject: Re: [xsl] getting the longest text node From: Rick Taylor <taylor@xxxxxxxx> Date: Tue, 11 Mar 2003 16:58:29 -0700 | 
<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>hi!
i have a xml document like this:
<root> <foo> <apple>a</apple> <orange>oiasd</orange> </foo> <foo> <apple>hellooooo</apple> <orange>test</orange> </foo> </root>
what would be the most performant and best way to get the longest text of a apple node, and the longest text of a orange node?
thanks alot!
ciao! florian
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Rick Taylor XML Developer PPDM Association
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| RE: [xsl] getting the longest text , Michael Kay | Thread | [xsl] How to Handle Bad XML (or Wor, Ted Stresen-Reuter | 
| RE: [xsl] getting the longest text , Wendell Piez | Date | Re: [xsl] FOP: fo:leader problems, Brook Ellingwood | 
| Month |