I hope that makes sense. I have the following XML document.
<PrinterDirectory>
<Country Name="UK>
<Region Name="Aberdeen" />
<Region Name="Birmingham" />
<Region Name="London" />
</Country>
<Country Name="France">
<Region Name="Paris" />
<Region Name="Bordeaux" />
</Country>
</PrinterDirectory>
What is the LINQ to retrieve just the regions of UK for example?
I've tried
varRegionQuery = from items in xdoc.Descendants("Country")
where items.Attribute("Name").Value == "UK"
select new
{
_Region = items.Element("Region").Attribute("Name").Value
};
That however only retrieves "Aberdeen".