View Single Post
Old February 13th, 2007, 06:13 AM
Authorized User
Join Date: Feb 2007
Location: CHENNAI, TAMILNADU, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to SOMANATHAN10

My requirement is like this.

I need to repeat the header between every 10th line in my xsl.
For most of the files I have done it with <xsl:if test="position() mod 10 = 1">
and succeded.
In one of the file I am not able to implement the same logic since the position() is changing frequently.

I know that in xsl reassigning of variable is not possible.

Since the for-loop is followed by a if condition the position value changes.

I want to find out how many times this if condition gets satisfied?

 <xsl:for-each select="/job/summary/sunAlertReport/rs:sunAlertReportSummary/rs:sunAlertSummaryList/rs:sunAlertSummary/rs:sunAlertId[generate-id()=generate-id(key(&apos;distinct-segcode&apos;,.))]">
                                    <xsl:sort order="ascending" select="."/>
                                    <xsl:variable name="SA" select="."/>
                                    <xsl:if test="count(/job/summary/sunAlertReport/rs:sunAlertReportSummary/rs:sunAlertSummaryList/rs:sunAlertSummary[rs:sunAlertId=$SA]/rs:oriNext/rs:oriNextList/rs:oriRule[rs:severity = 'Critical']) &gt; 0">