Re: [xsl] Re: Keeping a running total?

Subject: Re: [xsl] Re: Keeping a running total?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Jul 2006 13:22:02 -0400
At 2006-07-12 12:52 -0400, Steve wrote:
Forgive me for the tangent, especially if it sounds ignorant, but as a
newbie to XSL I have a hard time understanding the benefit in not
being able to redefine a variable.  While I do not doubt the talent
and genius that went into the above examples and speculations, I can't
imagine a benefit that outweighs the time economics involved in coming
up with the above solutions, versus simply doing a $variable =
$variable - $x and being done with it in 10ish lines.

Supporting such a concept negates many opportunities for implementation parallelism and optimization that can differentiate implementations all supporting a single standard.

XSLT is side-effect free, by design, thus not
allowing things like changing variables (which are side effects).

Consider that, with the given design, once you
implement and debug a given XSLT template rule,
there is nothing possible *by design of the
language* that would break the functioning of
that template rule.  I would think just that
savings in debug time alone would outweigh any savings in development time.

Also, a single template rule can be applied
*simultaneously* to multiple source tree nodes,
with the resulting result tree fragments
assembled in current node list order ... which
would make your legacy programming requirement possible.

Please check the archives ... this question has
been asked often since XSLT was standardized in
1998.  Please weigh innovation with legacy
approaches when you are considering the arguments.

I hope this helps.

. . . . . . . . Ken


-- Registration open for UBL training: Montrial, Canada 2006-08-07 Also for XSL-FO/XSLT training: Minneapolis, MN 2006-07-31/08-04 Also for UBL/XML/XSLT/XSL-FO training: Varo,Denmark 06-09-25/10-06 World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread