I was trying to use a LINQ query that will iterate through an xml document. However I wanted to either use an OR statement or a string.toLower() to make sure it will always get the data it needs
I currently have:
// read all <item> tags and put the in an array.
XDocument xml = XDocument.Parse(xmlData);
var newItems = (from story in xml.Descendants("item")
select new Feed
{
Title = ((string) story.Element("title")),
Link = ((string) story.Element("link")),
Description = ((string) story.Element("description")),
PublishDate = ((string) story.Element("pubDate")),
}
).Take(20).ToList();
what I still want to change:
- (E.G.)
Title = ((string)story.Element("title"))
needs to search case insensitive. from story in xml.Descendants("item") select new Feed
needs to search in item as well as in entry (both case-insensitive).
PS: as I am iterating through the an RSS document I cannot directly access the XML document.
thanks for input.