Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Error in XPath Expression >Thread Next - Re: Error in XPath Expression Re: Error in XPath ExpressionTo: NULL Date: 11/3/2005 7:14:00 AM I tried that but its also returning the same value as before , when i counted in XML the total "<startValue>1</startValue>" are 59 , it seems grand total is correct , some problem with group total(the Group Totals are 2,3,1,2,0,2,0,0,16,1,29 and if add all these numbers its coming around 56), is my grouping logic correct? "Oleg Tkachenko [MVP]" wrote: > xslspy wrote: > > <xslt:variable name="values2" > > select="NewDataSet/Table/startValue/text()"/> > > <td> > > Value : > > <xslt:value-of select="sum($values2)"/> > > Avg : > > <xslt:value-of select="(sum($values2/startValue)) div count($values2)"/> > > Here is the problem. $values2 selects text nodes inide startValue > elements, so $values2/startValue is wrong. > Try > <xslt:variable name="values2" select="NewDataSet/Table"/> > <td> > Value : > <xslt:value-of select="sum($values2/startValue)"/> > Avg : > <xslt:value-of select="(sum($values2/startValue)) div > count($values2)"/> > </td> > > -- > Oleg Tkachenko [XML MVP, MCAD] > http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
