Hi,
I'm trying to evaluate a sum expression trougth .NET 2
System.Xml.XPath.XPathNavigator object.
My code is :
Dim document As New System.Xml.XmlDocument()
document.LoadXml("<?xml
version=""1.0""?><root><a>28.7</a><a>9.18</a><a>4.32</a></root>")
Dim navigator As System.Xml.XPath.XPathNavigator =
document.CreateNavigator()
navigator.Evaluate("sum(//a)")
My XML source is :
<?xml version="1.0"?>
<root>
<a>28.7</a>
<a>9.18</a>
<a>4.32</a>
</root>
When I evaluate this expression, the result is 42.19999999996, and
should be 42.2 ... So I read some news and the W3C recommendation about
conversion to numeric values in
http://www.w3.org/TR/xpath#section-Number-Functions .
There is a function called number() that effectively convert XML string
values to numeric values. But with .NET, it raise a
System.Xml.XPath.XPathException ...
Does MS-XML implements this number function ?? Any idee ?
Thanks a lot.
Best regards, Pascal