title: xslt 1.0 how to create differentes variable inside foreach loop
body: <p>i have xml source as result of sql query and i show all on browser with xsl file. Inside a for each loop i need to create dinamically a different variable for each iteration because of i have to pass this variable to javascript function to be elaborated and the result push html on a tag with ID. I don't know how to assign a correct name to the variable. I wrote this that doesn't work:</p>
  
  <pre><code>&lt;xsl:for-each select="Record"&gt;
    &lt;table id="tableId-{position()}"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;Testata 1&lt;/th&gt;
          &lt;th&gt;Testata 2&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;xsl:variable name="variableN"&gt;
      &lt;xsl:call-template name="string-replace-all"&gt;
        &lt;xsl:with-param name="text" select="testo" /&gt;
        &lt;xsl:with-param name="replace"&gt;'&lt;/xsl:with-param&gt;
        &lt;xsl:with-param name="by"&gt;\'&lt;/xsl:with-param&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:variable&gt;
    &lt;script&gt;
      displayTableRowsDueColById('&lt;xsl:value-of select="$variableN" /&gt;');
    &lt;/script&gt;
    &lt;/xsl:if&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>