N
Nicolas
Hi,
I've been working on this problem for a couple of days and now i have no
more ideas.
first, this problem only happens with jdk 1.5, everything was fine with
jdk1.4.
I'm using a function to calculate the maximum value of some nodes passed
as argument, which i found here :
http://www.exslt.org/math/functions/max/math.max.html
<xsl:template name="max">
<xslaram name="nodes" select="/.."/>
<xsl:choose>
<xsl:when test="not($nodes)">NaN</xsl:when>
<xsltherwise>
<xsl:for-each select="$nodes">
<xsl:sort data-type="number" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="number(.)"/>
</xsl:if>
</xsl:for-each>
</xsltherwise>
</xsl:choose>
</xsl:template>
Now, if I call this function, it returns nothing.
<xsl:variable name="maxValue">
<xsl:call-template name="max">
<xsl:with-param name="nodes" select="/some/number/values"/>
</xsl:call-template>
</xsl:variable>
If i remove the <xsl:sort .....> line in the function, it returns the
first value (which is logic)
If I use the function "inline", it works :
<xsl:variable name="maxValue">
<xsl:for-each select="/some/number/values">
<xsl:sort data-type="number" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="number(.)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
Thanks for your help
I've been working on this problem for a couple of days and now i have no
more ideas.
first, this problem only happens with jdk 1.5, everything was fine with
jdk1.4.
I'm using a function to calculate the maximum value of some nodes passed
as argument, which i found here :
http://www.exslt.org/math/functions/max/math.max.html
<xsl:template name="max">
<xslaram name="nodes" select="/.."/>
<xsl:choose>
<xsl:when test="not($nodes)">NaN</xsl:when>
<xsltherwise>
<xsl:for-each select="$nodes">
<xsl:sort data-type="number" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="number(.)"/>
</xsl:if>
</xsl:for-each>
</xsltherwise>
</xsl:choose>
</xsl:template>
Now, if I call this function, it returns nothing.
<xsl:variable name="maxValue">
<xsl:call-template name="max">
<xsl:with-param name="nodes" select="/some/number/values"/>
</xsl:call-template>
</xsl:variable>
If i remove the <xsl:sort .....> line in the function, it returns the
first value (which is logic)
If I use the function "inline", it works :
<xsl:variable name="maxValue">
<xsl:for-each select="/some/number/values">
<xsl:sort data-type="number" order="descending"/>
<xsl:if test="position() = 1">
<xsl:value-of select="number(.)"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
Thanks for your help