Lists Home |
Date Index |
As Michael pointed out, please post XSLT related questions at the
xsl-list hosted by www.mulberrytech.com.
To answer your present question, I would like to suggest a simple way
to implement abs() functionality in XSLT 1.0 (XSLT 2.0 has it
built-in, so no need to worry with XSLT 2.0).
Write a named template for this..
Here is the code:
<xsl:param name="n" />
<xsl:when test="$n >= 0">
<xsl:value-of select="$n" />
<xsl:value-of select="0 - $n" />
Call this as:
<xsl:with-param name="n" select="3" />
Will produce output: 3
<xsl:with-param name="n" select="-10" />
Will produce output: 10
On 7/6/06, Webmaster <Webmaster@comtrol.com> wrote:
> Hello. I'm using Saxon 6.5.3 and am trying to get the abs function to work.
> I tried math: and fn: but I'm getting the error: "unknown system function".
> I've tried several name spaces, with out any success.
> It seems to me that maybe saxon doesn't with it? my xsl namespace is:
> At this point I'm kinda lost and not really knowing what I need. So how do I
> find a libary of math functions? do I have to download some files? do I have
> to update the xsl namespace?