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>
--~--