Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Sum Returns 0

From: Steph@-----------.---------.---
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent