I work in xslt 2.0 and I have a line in my code like this:
<xsl:value-of select="//dbquery[@id='INLIJVING']//rows/row[@BudgetaryEnvelop_Year = $RefBef][1]/@BudgetaryEnvelop_Year"/></xsl:variable>
This works fine. But I want to write this with a dynamic parameter name instead of @BudgetaryEnvelop_Year
.
I tried to define a param $target
and to change the line like this:
<xsl:value-of select="//dbquery[@id='INLIJVING']//rows/row[$target = $RefBef][1]/@BudgetaryEnvelop_Year"/></xsl:variable>
But this doesn't work. It doesn't execute the value-of
. I tried to pass it like a string like this:
<xsl:value-of>
<xsl:attribute name="select">//dbquery[@id='INLIJVING']//rows/row[<xsl:value-of select="$target"/>=<xsl:value-of select="$RefBef"/>][1]/@BudgetaryEnvelop_Year</xsl:attribute>
</xsl:value-of>
But that doesn't work either.