Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/delibero.git

Import and use XPath functions for math abs operation.

AuthorDave Jarvis <email>
Date2015-01-15 19:16:49 GMT-0800
Commit5fddd0a58bc14a1d9619269bfc7b0897d751170e
Parent542535d
source/xsl/math.xsl
| Copyright 2014 White Magic Software, Inc.
+-->
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="2.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:variable name="PI">3.14159265358979323846264338327950</xsl:variable>
<xsl:template name="abs">
<xsl:param name="x"/>
- <xsl:value-of select="($x &gt;= 0) * $x - not($x &gt;= 0) * $x"/>
+ <!--xsl:value-of select="($x &gt;= 0) * $x - not($x &gt;= 0) * $x"/-->
+ <xsl:value-of select="fn:abs( $x )"/>
</xsl:template>
Delta5 lines added, 2 lines removed, 3-line increase