I am using Visual Studio 2013, C#...
I have this XML in variable 'myXml':
<root>
<article><title>A1</title><category><title>Geography</title></category></article>
<article><title>A2</title><category><title>History</title></category></article>
<article><title>A3</title><category><title>Geography</title></category></article>
<article><title>A4</title><category><title>Finance</title></category></article>
</root>
How can I retrieve each which has a category title of "Finance" using LINQ2XML, as either a lambda or plain LINQ query?
I have this LINQ query which does not work:
var doc = XDocument.Parse(myXml);
var l = (from d in doc.Elements("root").Elements("article")
where d.Elements("category").Elements("title").Equals("Finance")
select d);