<xsl:variable name="filterValue"
>@subject = 'Subject To Filter On'</xsl:variable>
<xsl:for-each select="$Rows[$filterValue]">
It seems to me that the $filterValue is being treated as a literal string rather than being evaluated. How can I make it so that the variable’s value is evaluated instead?
Desired result:
<xsl:for-each select="$Rows[@subject = 'Subject To Filter On']">
I apologize if this has been answered before, I don’t know much terminology about XSL so I’m having trouble searching online. Thanks.
Dynamic evaluation of XPath expressions is not supported in both XSLT 1.0 and XSLT 2.0.
Usually, there are workarounds.
In this specific case you can have (global/external) parameters:
and then in your code: