This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Something like eval()? and Thanks!


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
requirements).

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

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]