[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Increment/decrement a variable in XSL

Subject: Re: Increment/decrement a variable in XSL
From: Petr Cimprich <petr@xxxxxxxxxxxx>
Date: Thu, 04 Apr 2002 11:02:36 +0200
increment variable in xsl

Julian Reschke wrote:


I would use an external variable and a set of functions (increase,
decrease, getValue) defined using the script element from the
http://www.exslt.org/functions namespace.

I think when you want to increment/decrement a variable, you may be
justified to escape to a procedural language and to increment/decrement
a variable simply. XSLT is not designed for this task and all other ways
are more or less workarounds, IMHO.

I see this is not a "pure XSLT" solution but I think it's appropriate
for this non-XSLT task.


Following this line of argument it may be better not to use XSLT at all.



I don't think so. It may just be better not to use XSLT for everything :)




You *are* aware that using extension functions to change variable values not
only ties you to a specific extension, but also to a particular
implementation/version (execution order, variable evaluation order...)?


I think that EXSLT.org's primary goal is to make extensions (more) portable. The suggested solution should work with every processor supporting EXSLT's funct:script. I agree that this may be mere theory and I'm not sure how many processors support this extension element now.


Anyway, facing a non-XSLT problem such as this one, one should consider all solutions including XSLT extensions or even some other ways than XSLT. I'm not aware of a context of this problem, it's likely that an XSLT workaround is still the best solution.

--
Petr Cimprich
Ginger Alliance
www.gingerall.com




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.