Re: [xsl] xsl:function, arithmetic

Subject: Re: [xsl] xsl:function, arithmetic
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 14 Feb 2005 17:52:31 GMT
  <xsl:function name="my:increase">
      <xsl:param name="i" />
      <xsl:value-of select="round(1.2 * $i)" />
  but all the expressions in my
  stylesheet which use this function seem to return non-numerical results.

value-of generates a text node with the string value of the number

probably something like

<xsl:function name="my:increase" as="xs:decimal">
    <xsl:param name="i"  as="xs:decimal"/>
    <xsl:sequence select="round(1.2 * $i)" />

would return something that is a number for use in further xpath
computation. (untested)


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread