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 12:01:00 PM 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 | |||
|
