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