I have an xml file that looks like this. I am trying to create a query that selects only elements with the attribute "Channel" and the value "Automotive".
<item>
<title>Industries</title>
<category type="Channel">Automotive</category>
<category type="Type">Cars</category>
<category type="Token">Article</category>
<category type="SpecialToken">News</category>
<guid>637f0dd7-57a0-4001-8272-f0fba60feba1</guid>
</item>
Here is my code
var feeds = (from item in doc.Descendants("item")
where item.Element("category").Value == "Channel"
select new { }).ToList();
I tried using the item.attribute method, but I cannot get the value inside the Item, only the Value attribute is of type
Can someone please help me with this?
Cheers, Chris
Chris source
share