The doc.SelectNodes is a convenience method that in turn calls
this.CreateNavigator().Select(xpath)
Note that XPathNavigator.Select returns an XPathNodeIterator and not an
XmlNodeList and hence the doc.SelectNodes internally creates an
XmlNodeList() that is returned.
Thanks,
Priya
"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
I got a question on executing the xpath. Can someone let me know which way
is
faster for the following two scenarios (one with XmlDocument and the other
using XmlDocument.CreateNavigator())?
XmlDocument doc = new XmlDocument();
doc.Load(input);
1. XmlNodeList nodes = doc.SelectNodes(xpathexp);
2. XmlNodeList nodes = doc.CreateNavigator().Select(xpathexp);