I have a attribute called ID, which is incremented 1 everytime the value is assigned it to.I have a situation where the value to be incremented everytime the loop is entered. The outer loop has 2 records and inner loop has 3 records. 

Outer loop 1 - Inner loop 1, 2, and 3, the ID attribute gets incremented as 1, 2 and 3, but 

Outer loop 2 - Inner loop .... again the ID attribute starts with 1. I need this to be 4, 5 and so on..

This increment ID has no data related to the input XML file. All the processing has to be done in the XSLT.

XSLT FIle :

```
<xsl:variable name="localISYMPid" select="0"/>  
<xsl:element name="Test1">   

    <xsl:for-each select="Solutions/Solution">

        <xsl:if test="Observations/Observation!= ''  ">

            <xsl:for-each select="Observations/Observation">
                <xsl:element name="Roles">

                    <!-- Generating the ID value -->
                    <xsl:variable name="ids" select="generate-id(.)"/>
                    <!-- ***************************-->

                    <xsl:attribute name="CK"><xsl:value-of select="substring-after($ids,'Solution')"/></xsl:attribute>
                    <xsl:attribute name="ID"><xsl:value-of select="position() + $localISYMPid "/></xsl:attribute>
                </xsl:element>
            </xsl:for-each>
        </xsl:if>
    </xsl:for-each>
</xsl:element>

```

Please help me in printing the value of ID 4 as when the inner loop is looped 3 times for outer loop 1 and for outer loop 2 and when the inner loop is 1, the ID value shall be 4 .as of now, its printing 1 again..

```
ID     1
ID     2
ID     3
----------
ID     1(it should print 4)

```

I am using XSLT 1.0

Thank you,
Ramm