Hello Holger,

there is an extension library for XSLT written by Dimitre Novatchev. You can find it at http://fxsl.sourceforge.net/. It contains for example trigonometric functions.
And if you really need XSLT for such an extreme logic, you can ask him - I'm sure he can help you with implementing the algorithm. But consider that XSLT was created for transforming XML trees into trees, not for calculating complex algorithms.


Regards,

Joerg

[EMAIL PROTECTED] wrote:
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>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to