xsl-list
[Top] [All Lists]

RE: Selecting from a node-set using variable path

2003-02-19 10:22:22
Hi Gary.

This doesn't:
  <xsl:variable name="t2" select="$myNodeSet/$myPath"/>

You can't do this directly, has others already told you. You have to use
some sort of evaluate function.


I'm using MSXML 4.0 and it's complaining with:
  NodeTest expected here.
  $myNodeSet/-->$<--myPath
which makes sense.



With MSXML you can do something like:
<msxml:script language="Jscript" implements-prefix="user">
 function find(node,path) {
  return node.selectSingleNode(path);
 }
</msxml:script>

And then:
<xsl:variable name="t2" select="user:find($myNodeSet,$myPath)"/>

Hope that this helps you.


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