Is dynamic evaluation of xpath variable string possible using .net 2.0 xslt implementation?

Posted by Crocked on Stack Overflow See other posts from Stack Overflow or by Crocked
Published on 2010-03-13T12:09:26Z Indexed on 2010/03/13 12:15 UTC
Read the original article Hit count: 175

Filed under:
|
|

Hi, I'm trying to evaluate an xpath varable I'm building dynamically based on the position of the node.

I can create the xpath string in a variable but when I select the value of this just get the string and not the node set I need.

I use the following to create the xpath

<xsl:variable name="xpathstring" select="normalize-space(concat(&quot;//anAttribute[@key='pos&quot;,position(),&quot;']&quot;))"/>

and try to output the value with the following.

<xsl:value-of select="$xpathstring"/>

If I execute the xpath in my debugger I get the nodeset but in my xml output only get the xpath string which looks like this //anAttribute[@key='pos1']

I had a look at exslt dyn:evaluate which seems to enable this but this seems to be only supported by certain processors and doesn't provide a standalone implementation or at least as far as I could see (currently using the standard .net 2.0 xslt whihc is only xslt 1.0 as far as I recall)

Is there anyway to handle this without changing processor? Kind Regards, Crocked

© Stack Overflow or respective owner

Related posts about xslt

Related posts about xpath