This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: !!!counters in XSL!!!
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] !!!counters in XSL!!!
- From: tcn at melvaig dot co dot uk (Trevor Nash)
- Date: Thu, 05 Apr 2001 10:16:14 GMT
- Organization: Melvaig Software Engineering Limited
- References: <80F5674514B4D311BAFC0040F6A45EEE113E17@ntserver>
- Reply-To: xsl-list at lists dot mulberrytech dot com
On Thu, 5 Apr 2001 11:36:25 +0200, you wrote:
>> can anyone please tell me whether you can have counters in
>> XSL? I mean I
>> want to increment a variable each time I go into a certain
>> for-each loop.
>>
>
>Hola a todos, Rosa:
>
>Some time ago i've developed a way to do simple interations with no
>recursivity, only valid for short numbers of iterations useful for i.e
>months..
>
>...
Please, spend the time to learn XSLT properly. Many of these problems
can be easily solved with a correct understanding of things like
position() and xsl:number. Where those do not work, a recursive
solution is often best. You may have learned from other languages
that recursion is bad: this is NOT true for XSL. The language is
carefully designed so that the XSLT processor can convert what you
write as recursion into a loop.
Follow the links on the web site you see quoted on all messages on
this list, or look at Mike Kays book XSLT programmers reference.
There you will find many examples of how to do these things in a way
that is both efficient and easy to understand.
I wonder if there is a market for a transformation engine that lets
you write the spec in Fortran ;-)
Best Regards,
Trevor Nash
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list