It should still list the nodes in the order in which it is defined in the
document. I have'nt noticed any difference between these 2 approaches.
In fact I would be surprised if the node order is different, since this
necessary to the validity of some XML documents.
-----------------
"Adam Smith" <ad*********@hotmail.com> wrote in message
news:Ow**************@tk2msftngp13.phx.gbl...
Is there any difference between using foreach and the count property, as
in:
XmlNodeList elemList = root.SelectNodes("//title");
for (int i=0; i < elemList.Count; i++)
{
//Display all book titles in the Node List.
Console.WriteLine(elemList[i].InnerXml);
}
Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!