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

Math "functions" for XSLT 1.0

Subject: Math "functions" for XSLT 1.0
From: COUTHURES Alain <alain.couthures@xxxxxxxxxxxxx>
Date: Wed, 03 Mar 2010 08:18:52 +0100
 Math "functions" for XSLT 1.0
Hello,

As you know, XSLT 1.0 and XPath 1.0 are now widely supported.

Unfortunately, XPath 1.0 doesn't come with mathematical functions such as "sqrt", "sin", "cos", "ln",... XPath 2.1 surely will but we'll have to wait to see it available in every environment.

Because such functions may be required for graphics generation, a workaround has to be used. Hopefully, named templates can be defined with XSLT 1.0: a name, one or more parameters and every XSLT 1.0 possibility, recursivity to be used instead of loops.

Algorithms based on +, -, * and / only are not that easy to find. CORDIC-based algorithms are not always very precise. Others, such as the ones for a Javascript engine, are optimized for binary processing.

Anyway, it works!

You can have a look at http://www.agencexml.com/math/math.xml and http://www.agencexml.com/math/math.xsl

As you can see, it's fast and precise.

Best regards,

Alain Couthures
<agenceXML>
Bordeaux, France
http://www.agencexml.com

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-2013 All Rights Reserved.