How to get row number in ItemStyle.XSL in SharePoint?
To get current row number in SharePoint ItemStyle.XSL, you have to define a variable as the following:
<xsl:variable name="CurPos">
<xsl:number></xsl:number>
</xsl:variable>
How to print current row number in ItemStyle.XSL?
To print the current row number in ItemStyle.XSL, you have to use the below line:
<xsl:value-of disable-output-escaping="yes" select="$CurPos"/>
How to check if current row is the FIRST ROW in ItemStyle.XSL?
To check if the current row is FIRST ROW in ItemStyle.XSL, you have to use the If Condition statement in XSL as the following:
<xsl:if test="$CurPos= 1">
<!-- your style-->
</xsl:if>
How to check if the current row is NOT the FIRST ROW in ItemStyle.XSL?
To check if the current row is FIRST ROW in ItemStyle.XSL, you have to use the Choose statement in XSL as the following:
<xsl:choose>
<xsl:when test="$CurPos= 1">
<!-- if true-->
</xsl:when>
<xsl:otherwise>
<!-- if false-->
</xsl:otherwise>
</xsl:choose>
See also, Get Current Page URL in XSLT SharePoint ItemStyle