need help with this statement
Posted: Thu Oct 12, 2006 10:27 am
Hi everyone,
I'm new to xslt and I need some help.
Here is the thing : I got this :
and this :
When I want to display $allMinTime, I got "NaN" as an answer, instead of a value. The thing I'm sure is that "/testResults/sample/@t" works because I use it here : <xsl:variable name="allTotalTime" select="sum(/testResults/sample/@t)" /> and when I display $allTotalTime, it works.
<xsl:sort data-type="number" /> seems to be the problem, but I'm not sure...
Any idea?
Thx for your help !
I'm new to xslt and I need some help.
Here is the thing : I got this :
Code: Select all
<xsl:variable name="allMinTime">
<xsl:call-template name="min">
<xsl:with-param name="nodes" select="/testResults/sample/@t" />
</xsl:call-template>
</xsl:variable>
Code: Select all
<xsl:template name="min">
<xsl:param name="nodes" select="/.." />
<xsl:choose>
<xsl:when test="not($nodes)">something</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$nodes">
<xsl:sort data-type="number" />
<xsl:if test="position() = 1">
<xsl:value-of select="number(.)" />
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:sort data-type="number" /> seems to be the problem, but I'm not sure...
Any idea?
Thx for your help !