title: counter variable in xslt for each
body: <p>Can anyone please advice how can I have value of i in the following XSLT code please?</p>
  
  <pre><code>&lt;xsl:for-each select="MenuItems/mainmenu"&gt;
  &lt;xsl:variable name="i" select="position()"/&gt;     
        &lt;li class="menu_hover" onclick="SwitchMenu(this, $i)" &gt;
   &lt;/li&gt;    
      &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>Thanks.</p>