Re: [xsl] Converting a string to node test

Subject: Re: [xsl] Converting a string to node test
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sat, 21 Apr 2001 21:34:53 +0100

> Does Microsoft have an extension function like saxon:evaluate() ?

Not a built-in one, no. However, you can define one of your own using
msxsl:script. The following one just interprets XPaths and is
basically the one posted by Andrew Kimball in January:

<xsl:stylesheet version="1.0"
                extension-element-prefixes="dyn msxsl">

<msxsl:script implements-prefix="dyn" language="jscript">
   function evaluate(context, expression)
         return context.nextNode().selectNodes(expression);



You could call it with:

   dyn:evaluate(., concat('@', $y))

to get the attribute named the same as the string held in $y on the
context node.

[I've used the EXSLT namespace here, but you should make up your own
unless you submit the function to the EXSLT site at]

I hope that helps,


Jeni Tennison

 XSL-List info and archive:

Current Thread