RE: [xsl] Converting a string to Uppercase or Lowercase without using translate() ?

Subject: RE: [xsl] Converting a string to Uppercase or Lowercase without using translate() ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 27 Nov 2007 22:01:53 -0000
> Without looking at what any real system does I'd expect the 
> variable to be more efficient (in general) Although I doubt 
> it's measurabl:-) with an entity ref you first have to expand 
> all the entities and then the XSLT engine has to parse  each 
> instance as a new string literal, whereas with a variable 
> reference the string is internalised just once as an xpath 
> string and then accessed by reference (unless the optimiser 
> decides to inline the variable reference I suppose...)

In the case of translate(), Saxon will build a hash table if the 2nd and 3rd
arguments are known at compile time. It will generally manage to do this not
only with string literals but also with variables whose value is known
statically - but you're relying a little bit more on the optimizer
recognizing patterns of usage.

Michael Kay
http://www.saxonica.com/

Current Thread