title: How to reset the position (position()) in xslt 1.0
body: <p>I have one XML file in which i have repeating , they have their own ITEM_ID and NAME. As you can see in the example, we have 6 ITEM:</p>
  
  <pre><code>&lt;ITEMS&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;1234&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_1&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;3216&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_2&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;8956&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_3&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;4562&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_4&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;4562&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_5&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
      &lt;ITEM&gt;
          &lt;ITEM_ID&gt;8569&lt;/ITEM_ID&gt;
          &lt;ITEM_NAME&gt;TEST_ITEM_6&lt;/ITEM_NAME&gt;
      &lt;/ITEM&gt;
  &lt;/ITEMS&gt;
  </code></pre>
  
  <p>I would like the result like this:</p>
  
  <pre><code>&lt;ARTICLES&gt;
      &lt;ARTICLE CODE="1"&gt;
          &lt;ARTICLE_ID&gt;1234&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_1&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
      &lt;ARTICLE CODE="2"&gt;
          &lt;ARTICLE_ID&gt;3216&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_2&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
      &lt;ARTICLE CODE="3"&gt;
          &lt;ARTICLE_ID&gt;8956&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_3&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
      &lt;ARTICLE CODE="4"&gt;
          &lt;ARTICLE_ID&gt;4562&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_4&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
      &lt;ARTICLE CODE="4"&gt;
          &lt;ARTICLE_ID&gt;4562&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_5&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
      &lt;ARTICLE CODE="5"&gt;
          &lt;ARTICLE_ID&gt;8569&lt;/ARTICLE_ID&gt;
          &lt;ARTICLE_NAME&gt;TEST_ARTICLE_6&lt;/ARTICLE_NAME&gt;
      &lt;/ARTICLE&gt;
  &lt;/ARTICLES&gt;
  </code></pre>
  
  <p>Here, the attribute CODE should have the position of the ITEM but where ITEM_ID are same for example 4th and 5th then in that case in the result file the CODE should have the same value as you can see in the result file (CODE attribute). The next Node shouldnt have the actual position from the input xml but the increment number as "5" as you can see the last ARTICLE in the result XML.</p>
  
  <p>Thanks in advance.</p>