Re: [xsl] Something like eval()? and Thanks!

Subject: Re: [xsl] Something like eval()? and Thanks!
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 7 Nov 2001 15:13:03 +0000
Hi Marty,

> Is there any way to force a string of the format "$foo" to evaluate
> into the matching parameter named $foo.

Only using extension functions. If you're using Saxon, you can use
saxon:evaluate(). Xalan has xalan:evaluate() which does roughly the
same thing.

The only problem is the availability of the variable bindings within
the extension function. Normally with this kind of question I'd say
that you can write your own with MSXML, but you're talking about
evaluating a variable, and I don't think that a user-defined function
would have access to those variable assignments. I got an error when I
tried accessing a variable with xalan:evaluate() as well.

Many of us are hoping that dynamic evaluation of XPaths will be
incorporated into XPath/XSLT 2.0 (though it's not on the

> What i'm hoping for is a more generic parameter matching system, where my
> XML might look like:
> <a href="foo.htm?custID={$custID}">My Account</a>

If you had the above *in a stylesheet* then it would do exactly what
you wanted to do. So you could generate the stylesheet that you want
from the XML template, and then run that stylesheet to get the result
you're after.



Jeni Tennison

 XSL-List info and archive:

Current Thread