|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to do this without updating a variable?
A little more thinking reveals that:
<xsl:choose>
<xsl:when test="position() = 1">
<tr>
<td><xsl:value-of select="."/></td>
<td>1</td>
<td><xsl:value-of select="@count"/></td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<td><xsl:value-of select="."/></td>
<td><xsl:value-of select="sum(preceding::reg/@count) + 1"/></td>
<td><xsl:value-of select="sum(preceding::reg/@count) +
@count"/></td>
</tr>
</xsl:otherwise>
</xsl:choose>
can be just:
<tr>
<td><xsl:value-of select="."/></td>
<td><xsl:value-of select="sum(preceding::reg/@count) + 1"/></td>
<td><xsl:value-of select="sum(preceding::reg/@count) + @count"/></td>
</tr>
because the sum of the empty set will be 0.
Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








