|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Funky Summation
----- Original Message -----
From: Alexey Gokhberg <alexei@xxxxxxxxxx>
>
> AND A BIT MORE GENERAL QUESTION:
>
> Is it possible to implement running counters in pure 100% XSLT, without
> using proprietary extensions?
There is no updateable variables in XSLT.
But there is general pattern for 'counter' :
template accumulator ( list ) {
$first element = take first element of the list ( position() = 1 )
$rest list = take the rest of the list ( position() > 1 )
$total-of-rest = {
if ( $rest ) {
call accumulator( $rest )
} else {
<!-- nothing. End of loop. -->
}
}
<xsl:value-of select = " $first + $total-of-rest " />
}
Invokation:
template( list-to-process )
>From my point of view, the answer is :
"Yes, it is always possible to implement running counters
in pure 100% XSLT"
Rgds.Paul.
PS. I wish I understand the question.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








