Hey, you would need to convert your XMLDocument to an XDocument/Xelement to be able to use it with LINQ.
XElement elements = XElement.Load(pathToFile);
var ranges = from r in elements.DescendantsAndSelf("range")
select r;
foreach (var x in ranges)
{
//do your work here.
}
HTH's :)
Please mark as the answer if your problem has been resolved as a result of my posting - Ta
NathanC
Member
21 Points
18 Posts
Re: Loop through sub XmlNodeList with C#
Sep 17, 2008 07:07 AM|LINK
Hey, you would need to convert your XMLDocument to an XDocument/Xelement to be able to use it with LINQ.
XElement elements = XElement.Load(pathToFile); var ranges = from r in elements.DescendantsAndSelf("range") select r; foreach (var x in ranges) { //do your work here. }HTH's :)Price is what you pay; value is what get;