As I know there's no out of box XSLT function for advanced calculation, anyone have any idea how I can do math such as Cosine/Sin() within XSLT? The requirement is also very specific which I need the extension to be downloadable(instead of pointing to a url) so that I can download it and reference as source within my XSL script. I am unable to download EXSLT source files to try as it seems like there's an issue with that page. Can you please also provide a simple example of how to reference the source within the script and calculate something simple like:
<input>
<num1>1</num1>
<num2>1</num2>
</input>
and have the output as:
<output>
<cosOfnum1>0.54030230586</cosOfnum1>
<sinOfnum2>0.8414709848</sinOfnum2>
</output>
Thank you!
Saxon 9 (including HE, tested with 9.6, see also http://saxonica.com/html/documentation9.6/functions/math/sin.html saying "From Saxon 9.6, available in all editions.") does have out of the box support for the functions defined in https://www.w3.org/2005/xpath-functions/math/, here is an example:
I have also tested that XmlPrime 4 runs the above stylesheet correctly when using the command line option
--xt30
so it also has built-in support for those functions.Altova XMLSpy 2017 also supports the functions in the namespace
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
out of the box but only inversion="3.0"
stylesheets.