Re: [xsl] error/confusion with translate function

Subject: Re: [xsl] error/confusion with translate function
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 11 Aug 2006 13:59:44 +0100
On 8/11/06, Duane Gran <dgran@xxxxxxxxxxxxx> wrote:
XSL Experts,

I'm getting some odd behavior from the translate() method.  I'm using
it, along with Saxonb 8-7-3j, to convert the value of an attribute
from upper case to lower case.  Below is the relevant line from my
source XML:

<desc id="songsie.y.illbk.42" dbi="songsie.Y.P42">

My XSL is defined as the following:

       <xsl:variable name="thumbnail-mixedcase" select="@dbi"/>
       <xsl:variable name="thumbnail" select="translate($thumbnail-
mixedcase,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqqrstuvwxyz')"/>
       <nines:thumbnail rdf:resource="http://www.blakearchive.org/
blake/images/{$thumbnail}.100.jpg"/>

My resulting document has has "...songsie.x.p42..." instead of
"...songsie.y.p42...".  Below is the output:

       <nines:thumbnail rdf:resource="http://www.blakearchive.org/
blake/images/songsie.x.p42.100.jpg"/>

I'm dumbfounded by this, especially since it works for well over a
thousand other cases.  I've looked at this closely with the debugger
in oXygen, but I can't make sense out of how the translate function
is converting "Y" into "x".  Can anyone shed light on this?

Look very closely at your a to z strings (especially the lowercase one)....


cheers
andrew

Current Thread