Evaluates the System.Xml.XPath.XPathExpression and returns the typed result.
- expr
- An System.Xml.XPath.XPathExpression that can be evaluated.
The result of the expression (Boolean, number, string, or node set). This maps to bool, double, string, or System.Xml.XPath.XPathNodeIterator objects respectively.
The following C# code returns a number after converting the Price/text() node to a number and multiplying the value by 10.
Example
XPathExpression expr = nav.Compile("Price/text()*10"); nav.Evaluate(expr);
The XPath position() and last() functions, unless used as a predicate in a location step, require a reference to a node set in order to be evaluated. In this case, you must use the overload which takes an System.Xml.XPath.XPathNodeIterator as an argument; otherwise, position() and last() return 0.
This method has no effect on the state of the System.Xml.XPath.XPathNavigator.