Skip to main content

xslt 1.0 math

Math "functions" for XSLT 1.0

Alain Couthures's picture

XSLT 1.0 and XPath 1.0 are 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, recursion to be used instead of loops. Read more »

Syndicate content