need help with this statement
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Thu Oct 12, 2006 10:16 am
need help with this statement
Post by tournevice »
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 !
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
If the values of all the /testResults/sample/@t attributes can be converted to numbers (they are numbers, booleans or nodesets which can be converted to numbers) you should not get NaN as a result. If not the non number value is converted to NaN. Can you post a sample of the input XML ?
Regards,
Sorin
If the values of all the /testResults/sample/@t attributes can be converted to numbers (they are numbers, booleans or nodesets which can be converted to numbers) you should not get NaN as a result. If not the non number value is converted to NaN. Can you post a sample of the input XML ?
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service