title: XSLT For-each in for-each position()
body: <p>I have a trouble with a position in XSLT, I will explain what I'm doing.</p>
  
  <p>I have a for each into another for each, like this...</p>
  
  <pre><code>&lt;xsl:for-each select="tagA"&gt;
     &lt;xsl:value-of select="position()"/&gt;
         &lt;xsl:for-each select="tagB"&gt;
             &lt;xsl:value-of select="position()"/&gt;
         &lt;/xsl:for-each&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>EDIT 1 : </p>
  
  <p>XML : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;main&gt;
  &lt;tagA&gt;
  &lt;row&gt;
   &lt;info&gt;
   tag A pos one
   &lt;/info&gt;
  &lt;/row&gt;
  &lt;row&gt;
   &lt;info&gt;
   tag A pos two
   &lt;/info&gt;
  &lt;/row&gt;
  &lt;tagB&gt;
  &lt;rowB posB="reference of tag A pos One"&gt;
  &lt;rowB posB="reference of tag A pos Two"&gt;
  &lt;/tagB&gt;
  &lt;/main&gt;
  </code></pre>
  
  <p>XSL : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
  &lt;xsl:template match="/main"&gt;
    &lt;xsl:for-each select="tagA"&gt;
         &lt;xsl:for-each select="tagB"&gt;
             &lt;xsl:if test="//tagA/info = 'tag A pos one'"&gt;
               HERE I WANT TAG A POSITION
             &lt;/xsl:if&gt;
         &lt;/xsl:for-each&gt;
  &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Its something like that, the question is: How can I get "tagA" position value in tagB select?</p>
  
  <p>Sorry for my bad English, and I hope you can help me. </p>
  
  <p>Thanks you for advance.</p>