
- VBForums
- .NET and More
- C#
- [2.0] Evaluate and Compile methods in XpathNavigator class..why to use them? benfits any?
-
Aug 28th, 2006, 03:48 PM
#1
Thread Starter
Hyperactive Member
[2.0] Evaluate and Compile methods in XpathNavigator class..why to use them? benfits any?
The following sample code is from MSDN.
XPathDocument document = new XPathDocument("books.xml");
XPathNavigator navigator = document.CreateNavigator();
XPathExpression query = navigator.Compile("sum(//price/text())");
Double total = (Double)navigator.Evaluate(query);
Console.WriteLine(total);
why should we Compile an XPath expression. The help file doesn't give any clear reasons for the usage of these two methods.
if any body have used these methods, please share your experience ..
thanks
-
Aug 29th, 2006, 12:36 AM
#2
Re: [2.0] Evaluate and Compile methods in XpathNavigator class..why to use them? benfits any?
I haven't used compiled XPath queries, but I would assume that their purpose is the same as regular expressions - efficiency and hence speed.

- VBForums
- .NET and More
- C#
- [2.0] Evaluate and Compile methods in XpathNavigator class..why to use them? benfits any?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|