Subject: RE: [xsl] 1 + 1 = 11 From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 18 Apr 2006 13:40:40 -0400 |
I'm trying to remember, but isn't "+" used for concatenation? So, yes, 1+1=11.
Cheers, Wendell
> -----Original Message----- > From: Eric White [mailto:eric.white@xxxxxxxxxxx] > Sent: Tuesday, April 18, 2006 1:19 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] 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>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] 1 + 1 = 11, Gosselin, Michael | Thread | [xsl] exclude-result-prefixes, Arulraj |
Re: [xsl] creating tags around a st, Jon Gorman | Date | [xsl] Merging multiple RSS feeds in, Robert Fidler |
Month |