Hi,
I'm trying to evaluate a sum expression trougth .NET 2
System.Xml.XPat h.XPathNavigato r object.
My code is :
Dim document As New System.Xml.XmlD ocument()
document.LoadXm l("<?xml
version=""1.0"" ?><root><a>28.7 </a><a>9.18</a><a>4.32</a></root>")
Dim navigator As System.Xml.XPat h.XPathNavigato r =
document.Create Navigator()
navigator.Evalu ate("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.XPat h.XPathExceptio n ...
Does MS-XML implements this number function ?? Any idee ?
Thanks a lot.
Best regards, Pascal