0

is it possible to find current-group node position when it is in for-each xslt

<xsl:variable name="cur" select="0" />
 <xsl:for-each select="current-group()">
   <xsl:if test="$cur=0 and flag !='0'">
    <xsl:variable name="cur" select="$cur + 1" />
    <!-- DO SOMETHING -->
</xsl:if>
</xsl:for-each>
Dev
  • 17
  • 4
  • It is not clear what you are asking, what is "the position" of a node? If you process a node-set (XSLT 1) or node sequence (XSLT 2 or later) with `xsl:for-each` then, inside, the call of the `position()` functions gives the position of the currently processed item in the input sequence. – Martin Honnen Jan 06 '22 at 11:38
  • Please do not post the same question twice. Edit your original question and clarify what exactly you are trying to achieve. – michael.hor257k Jan 06 '22 at 12:20

0 Answers0