title: Select xsl element based on index that is defined in a param
body: <p>I want to select an element by index with the indexed number being passed in with a param, the param is being passed in via PHP. Here's what I am trying:</p>
  
  <pre><code>//PHP
  $xslt-&gt;setParameter('','player',$player);
  $xslt-&gt;importStylesheet( $XSL );
  print $xslt-&gt;transformToXML( $data ); 
  
  //xslt
  &lt;xsl:param name="player" data-type="number"/&gt;
  
  &lt;template match="/"&gt;
      &lt;xsl:value-of select="result[$player]/@name" /&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>And I know the value of the param is being passed correctly because I can just output the value of the param ($player) and it will output the correct value. If I hard code the indexed number "$player" to any number of index I want like below:</p>
  
  <pre><code>&lt;template match="/"&gt;
      &lt;xsl:value-of select="result[2]/@name" /&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>it works. So, what I am doing wrong here. Can you not use params/variables to select indexes?</p>