This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: to extract the longest string (fwd)
- To: "C.V. Radhakrishnan" <cvr at md2 dot vsnl dot net dot in>
- Subject: Re: to extract the longest string (fwd)
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Fri, 18 Aug 2000 16:12:46 +0100
- Cc: xsl-list at mulberrytech dot com
- Reply-To: xsl-list at mulberrytech dot com
Rajagopal,
>I tested the following code in SAXON and I could not get the
>expected longest string, which is "cxxyycc".
What did you get instead? Which processor are you using?
The template that I posted was a cut down one, just assigning the longest
string to a variable. If you want to do something with that string (like
display it) then you have to add code to do that, e.g.:
<xsl:template match="table">
<xsl:variable name="longest">
<xsl:apply-templates select="row[1]" mode="get-longest" />
</xsl:variable>
<xsl:message>Longest: <xsl:value-of select="$longest" /></xsl:message>
</xsl:template>
When I do this, SAXON 5.4.1 gives me the message:
Longest: 'cxxyycc'
As does Xalan-C 0.40.0.
Cheers,
Jeni
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list