Re: [xsl] More-than-basic maths

Subject: Re: [xsl] More-than-basic maths
From: "andrew cooke" <acooke@xxxxxxxx>
Date: Fri, 18 Mar 2005 15:25:11 -0400 (CLT)
just following up on this, in case anyone googles for info as i was doing.

- while the fxsl library works for simple tasks, it fails on more complex
operations when using saxon 8.3 (both fxsl-1.2 and fxsl for xsl 2).

- with xalan, fxsl-1.2 does work (so there seems to be a problem with
saxon), but, it turns out, xalan supports exslt (extended xsl) which gives
you access to math:... functions, which have a nicer syntax than fxsl (at
least, as far as i understood things).

so the simplest solution seems to be to use xalan with the exslt math
extensions.

andrew

andrew cooke said:
>
> brilliant - works perfectly.  thanks.
>
> (a possible suggestion: for newbies like me, it would be nice to have a
> very very basic example right on the front page of the site, which gives
> the "import" element and a simple call to "sin" (for example).  now that i
> see how to do it, it is so simple it seems obvious, but at first i was
> confused how to call a "library" from xsl).
>
> thanks again,
> andrew
>
> Dimitre Novatchev said:
>> On Thu, 17 Mar 2005 22:50:16 -0400 (CLT), andrew cooke <acooke@xxxxxxxx>
>> wrote:
>>>
>>>
>>> Hi,
>>>
>>> I can't work out how to do more complex maths (like logarithms, trig
>>> functions, etc) in XSL.  Is it possible?  If not, is there any other
>>> tool
>>> I can use in an xml pipeline?  Is the only option writing SAX or DOM
>>> code
>>> in some non-dedicated programming language?
>>>
>>> (I'm generating plots from XML data via XSL to SVG)
>>>
>>
>> FXSL (a function/template library implementing HOF in XSLT and written
>> in pure XSLT)  implements:
>>
>> Math functions:
>>      http://fxsl.sourceforge.net/articles/xslCalculator/The%20FXSL%20Calculator.html
>>
>> Random number generators:
>>     http://fxsl.sourceforge.net/articles/Random/Casting%20the%20Dice%20with%20FXSL-htm.htm
>>
>> Higher-order functions, currying/partial application, etc...:
>>     http://fxsl.sourceforge.net/articles/FuncProg/Functional%20Programming.html
>>     http://fxsl.sourceforge.net/articles/PartialApps/Partial%20Applications.html
>>
>>     http://www.mulberrytech.com/Extreme/Proceedings/xslfo-pdf/2003/Novatchev01/EML2003Novatchev01.pdf
>>
>>
>>
>> A good example of the math capabilities of FXSL for XSLT 2.0 was
>> recently provided at:
>>
>>     http://www.xslt.com/html/xsl-list/2005-01/msg00521.html
>>
>>
>> Cheers,
>> Dimitre Novatchev
>>
>>
>
>
> --
> ` __ _ __ ___  ___| |_____   work web site:
> http://www.ctio.noao.edu/~andrew
>  / _` / _/ _ \/ _ \ / / -_)  personal web site:
> http://www.acooke.org/andrew
>  \__,_\__\___/\___/_\_\___|  list:
> http://www.acooke.org/andrew/compute.html
>
>


-- 
` __ _ __ ___  ___| |_____   work web site: http://www.ctio.noao.edu/~andrew
 / _` / _/ _ \/ _ \ / / -_)  personal web site: http://www.acooke.org/andrew
 \__,_\__\___/\___/_\_\___|  list: http://www.acooke.org/andrew/compute.html

Current Thread