Sorry Dudes,
I couldn't find an appropriate group to post about XML/XSLT issues.
I can only post to these close groups.
In most of programming languages are VERY easy to do:
int i = 0;
i = 3;
i = i + 1;
i += 2;
i++;
But how can I do these in XSLT?
I got error when I do
<xsl:variable name="i" select='0' />
<xsl:variable name="i" select="$i + '1' />
Can dudes (American West Coast's Term) out there can help?
Thank Q!
kaeli - 29 Mar 2005 14:44 GMT
> In most of programming languages are VERY easy to do:
>
[quoted text clipped - 5 lines]
>
> But how can I do these in XSLT?
You really shouldn't, even if you can.
Here's a great explanation why.
[quote src=http://www.xslt.com/html/xsl-list/2002-04/msg00185.html]
However, it's very dangerous to use extension functions or extension
elements that have side-effects in XSLT, such as counters or
extensions that read and update databases. This is because XSLT is
designed around the basic assumption that you can evaluate the same
expression multiple times without affecting the result of that or
other expressions.
[/quote]
More points made there, too. Check out the full link.
http://www.xslt.com/html/xsl-list/2002-04/msg00185.html

Signature
--
~kaeli~
Reading while sunbathing makes you well red.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Anton Spaans - 29 Mar 2005 17:55 GMT
> Sorry Dudes,
>
[quoted text clipped - 18 lines]
>
> Thank Q!
As the previous poster said as well, XSL is designed as a Meta Language, a
pure functional language that does not allow for so-called 'side-effects'.
Such languages are purely declarative in nature, allowing its
interpreters/compilers for any valid possible optimization that the
interpreters/compilers can come up with and no unpredictable side-effects
are introduced.
Take a look at this link:
http://www.kuro5hin.org/story/2002/1/13/223854/606
-- Anton Spaans.
Bryce - 29 Mar 2005 20:35 GMT
>Sorry Dudes,
>
[quoted text clipped - 10 lines]
>
>But how can I do these in XSLT?
You can't.
>I got error when I do
> <xsl:variable name="i" select='0' />
[quoted text clipped - 3 lines]
>
>Thank Q!
--
now with more cowbell