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
[quoted text, click to view] "Jon" <Jon@discussions.microsoft.com> wrote in message
news:1AA190A7-B701-41AC-B530-1D80A84CF8C5@microsoft.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);