----------------------------------------------------------------
In the above xml document how can i find the following result where -Type="SubMenu"
Text="Langrennsbindinger Skøyte" Value="1060402"
Text="Rulleskipigger" Value="1061304"
Text="Terrengsykkel Herre" Value="1010101"
--My Query Attempt--
XDocument xmlDoc_region = XDocument.Load(PathofXML);
var list_category = from nodeitem in xmlDoc_region.Elements("Navigation")
where nodeitem.Attribute("Type").Value == "MainMenu"
select new
{
CategoryName = nodeitem.Element("Node").Attribute("Text").Value,
CategoryId = nodeitem.Element("Node").Attribute("Value").Value
};
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Arunava BhattacharjeeRank #635 · 3.8K reputationPosted Sep 12, 2014, 3:53 AM EDT
var query = (from n in xDoc.Descendants("Navigation")
where n.Attribute("Type").Value.Equals("SubMenu")
from view in c.Elements("Node")
select new
{ CategoryType = view.Attribute("Text").Value,
CategoryId = view.Attribute("Value").Value
}) .ToList();
Ruchir SaxenaRank #796 · 2.9K reputationPosted Sep 19, 2014, 2:30 AM EDT