-
increment count
Hi
I've got a stylesheet with a for loop
<xsl:for-each select="a:multistatus/a:response">
I've got an element in it:
<a>
<xsl:attribute name="href">Clipping.aspx?sTitle=<xsl:value-of select="(a:propstat/a:prop/a:href)"/>
</xsl:attribute>
</a>
How can I add an incremented ID value for each element in the loop,so the link looks like this:
Clipping.aspx?ID=i&sTitle=<xsl:value-of select="(a:propstat/a:prop/a:href)"/
Thanks
Kati
-
Re: increment count
Look at the xsl:number element. It's rather complex, so you may have to play a bit with it until you get it right.
-
Re: increment count
have you got an example? how do i increment it? and how do I attach it to the a href?
-
Re: increment count
I believe this should approximately work, but it depends on your input structure.
Code:
<xsl:for-each select="a:multistatus/a:response">
<a>
<xsl:attribute name="href">
<xsl:text>Clipping.aspx?ID=</xsl:text>
<xsl:number level="any" count="a:multistatus/a:response"/>
<xsl:text>sTitle=</xsl:text>
<xsl:value-of select="(aropstat/arop/a:href)"/>
</xsl:attribute>
</a>
</xsl:for-each>
-
Re: increment count