Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Sum Returns 0 Sum Returns 0To: NULL Date: 11/11/2008 8:53:00 AM Hello, I can't get simple addition to work in my xsl file. Here's some of the XML: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <myFields xmlns="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-08T18:17:49">... <groupServers> <txtNoCPU>5</txtNoCPU> <txtReqNtwrkBandw>2</txtReqNtwrkBandw> </groupServers> <groupServers> <txtNoCPU>4</txtNoCPU> <txtReqNtwrkBandw>8</txtReqNtwrkBandw> </groupServers> </myFields> Here's some of the XSL: <xsl:template match="/ns2:myFields"> <xsl:apply-templates select="//txtNoCPU"/> <w:p><w:r><w:t> <xsl:text>TOTALS test</xsl:text> </w:t></w:r></w:p> <w:p><w:r> <w:t> <xsl:text>CPUs </xsl:text> <xsl:value-of select="sum(//txtNoCPU)"/> </w:t></w:r></w:p> </xsl:template> And this is the result of the transform: TOTALS test CPUs 0 Instead of 0, I expected 9. I've tried everything I can think of, but I'm running out of ideas. (At least the groupServers stuff no longer disappears entirely, and no more NaN) I started with an Infopath 2003 form, then opened the xml in Word 2003 and formatted it. Then I used the wml2xslt tool to create the xsl file. The original Infopath form did the addition I wanted, but it wouldn't come across to Word. (I tried getting the code from InfoPath and adding it back in with no luck). Any ideas? (I'm a beginner...) Thanks, Steph | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
