xsl-list
[Top] [All Lists]

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

2007-11-27 15:03:02
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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>