RE: XSL 2.0 - Proposal for a indirect dereferencing requirement.

> I am fairly new to XML/XSL, but I have been keeping a list of 
> the most limiting issues I have encountered with XSL 1.0.  
> Thankfully it appears that most of the ones on my list are 
> being addressed by XSL 2.0.
> 
> However, one issue that I am encountering more frequently the 
> more I use XSL is that there is no way to indirectly 
> dereference a variable.  There is no way to construct or 
> establish the name of variable into a variable and then 
> dereference the constructed/established name.  In short, 
> there is no way to dereference a variable (var1) which 
> contains the name of another variable (var2) to get the value of var2.
> 
> I have seen many issues is some the XML/XSL news groups 
> archives related to users trying to construct a variable name 
> or use some other field to determine the name of the 
> variable, so I don't believe this problem is unique to my experience.

Thanks for the suggestion. We did give very careful thought to introducing a
dynamic evaluation capability in XSLT 2.0 (that is, the ability to construct
XPath expressions, including variable references, on the fly from strings),
and we decided against it. The basic reasons are difficulties in defining
the semantics in an interoperable way, and worries about the effect on
performance, optimization, and type safety.

The decision was a difficult one with good arguments on both sides, but I
think we are unlikely to re-open the question.

You may be aware that several products have an xx:evaluate() extension
function which meets this requirement.

Michael Kay 

Received on Friday, 2 August 2002 14:33:55 UTC