[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

to extract the longest string. (fwd)

Subject: to extract the longest string. (fwd)
From: "C.V. Radhakrishnan" <cvr@xxxxxxxxxxxxxxx>
Date: Mon, 21 Aug 2000 12:28:16 +0530 (IST)
xsl longest string
Jeni Tennison 

While sending the following code you said

<xsl:template match="row" mode="get-longest">
  <xsl:variable name="current">
    <xsl:for-each select="col">
      <xsl:value-of select="@align" />
    </xsl:for-each>
  </xsl:variable>
  <xsl:variable name="longest">
    <xsl:apply-templates select="following-sibling::row[1]"
                         mode="get-longest" />
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="string-length($longest) > string-length($current)">
      <xsl:value-of select="$longest" />
    </xsl:when>
    <xsl:otherwise><xsl:value-of select="$current" /></xsl:otherwise>
  </xsl:choose>


  " So in effect calling this template on the second row
    element returns the longest result from all the rest of the rows," 

Would you please explain to me how calling this template on the second row
element returns the longest result from all  "the rest of rows" and how
the recursion is working in that place?

Thanks

Rajagopal




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.