This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: evaluate()
- To: "Kerr, David" <KerrDA at bankofbermuda dot com>
- Subject: Re: [xsl] evaluate()
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Wed, 14 Mar 2001 09:23:22 +0000
- CC: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <9F664D538536D411BD3200508B6FF01A01CDEAD5@bdant027.bda.bobda.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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