[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] evaluate()


Subject: Re: [xsl] evaluate()
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Mar 2001 09:23:22 +0000

Hi David,

> I am trying to get a node back from a constructed string in the
> TypePath var but understandably the constructed string is retuned
> not the data in the node
>
> I have to use MSXML3 and I cant seem to find an evaluate function or
> a work around

MSXML3 doesn't have an evaluate() function, but if you're just after
resolving paths (as opposed to evaluating or expressions, for example)
then you can write a JScript script that will do it for you.

This is one that Andrew Kimball posted in January:

  <msxsl:script implements-prefix="some-prefix" language="jscript">
  <![CDATA[
     function selectNodes(nsetCtxt, strExpr)
        {
           // Evaluating strExpr must result in a node-set
           // (unfortunately there is currently no evalExpr method on the MSDOM)
           return nsetCtxt.nextNode().selectNodes(strExpr);
        }
  ]]>
  </msxsl:script>

You call it by passing a node to be used as the context for resolving
the path (usually the context node) and the string that you want to
evaluate.

I hope that helps,

Jeni

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



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



Current Thread