"for loops" and the use of variables (like in imperative languages like
C/Java) are implemented differently in xslt. recursion is often used. i
recommend doing a search on "functional programming" and "xslt" in google.
there are probably many examples of how to write "functions" similar to
yours in xslt..
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 3/21/03 6:55 AM
Subject: XSL and script code - please help
Hi all,
I am currently developing a histogram (svg) to be
included in the Cocoon portal.
The current solution for generation of the SVG code is
XSL only.
Now I would like to add an algorithm for
y-axis autoscaling (see 'pseudocode' below). I am not
sure how to do this in pure XSL e.g.
-is there a fract() function ? I know that a floor
function exists.
- But what about the loop ?
- What about passing variables to this code (and
getting them back into the XSL script) ?
- Do I need further (script-)extensions to XSL to do
this ?
Best regards,
Holger
*******************************************
iReg=1;
regA=10**floor((max-min)/#-of-tics);
<top loop>
iReg++;
reg9=regA*floor(min/regA);
reg8=reg9+#-of-tics*regA;
if(max>reg8){ (would exit the loop if <=)
if(fract(iReg/4)==0)
{regA=1.25*regA;}
else
{regA=2*regA;}
{
<bottom loop>
*********************************************
___________________________________________________
The ALL NEW CS2000 from CompuServe
Better! Faster! More Powerful!
250 FREE hours! Sign-on Now!
http://www.compuserve.com/trycsrv/cs2000/webmail/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]