[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

1 + 1 = 11

Subject: 1 + 1 = 11
From: Eric White <eric.white@xxxxxxxxxxx>
Date: Tue, 18 Apr 2006 12:18:47 -0500
 1 + 1 = 11
What am I missing? I define a parameter, get the highest existing row number and I want to add a value to it -- so I can add the next table row with a new index. I get the index value correctly, but when I add one (1) to it, I get the string "11", rather than the number 2. Note that I specifically set the param to a number via the number() function. I've also tried using the number() function inside the select attribute of the apply-templates element, trying to coerce the result, but to no avail.

<xsl:template match="ntpServerTable">
<xsl:param name="rowindex">
<xsl:for-each select="ntpServerTableRow">
<xsl:sort select="ntpServerTableRowIndex" data-type="number" order="descending" />
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="number(ntpServerTableRowIndex)"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:param>
<xsl:apply-templates select="ntpServerTableRow"/>
<ntpServerTableRowIndex><xsl:value-of select="$rowindex+1"/></ntpServerTableRowIndex>


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.