I want to make a Counter value getting incremented based on a condition. But i was not able to increment a value or add 1 to a global variable. I was using the following code
<xsl:variable name="count">0</xsl:variable>
<xsl:variable name="incre">1</xsl:variable>
<xsl:template match="/">
<xsl:if test="$video1 != ''">
<xsl:variable name="count" select="number($count)+number($incrementor)"/>
<!-- display video1 -->
</xsl:if>
<xsl:if test="$video2 != ''">
<xsl:variable name="count" select="number($count)+number($incrementor)"/>
<!-- display video2 -->
</xsl:if>
<xsl:if test="$video3 != ''">
<xsl:if test="$count<2">
<xsl:variable name="count" select="number($count)+number($incrementor)"/>
<!-- display video3 -->
</xs:if>
</xsl:if>
<xsl:if test="$video4 != ''">
<xsl:if test="$count<2">
<xsl:variable name="count" select="number($count)+number($incrementor)"/>
<!-- display video4 -->
</xs:if>
</xsl:if>
</template>
How to increment the value of count or add 1 to it. Thanks in advance.
xsl:numbermay work better for you thancount().