LINQ to XML Selecting Child Elements
I am trying to extract information from an XML file into an object using LINQ to XML. Although I can return the document and section Id attributes I cannot get access to the Items for each section element, it returns an IEnumerable of all the items in the document. I know this is correct as I’m calling Descendants but am struggling to get it to return only the child items of each section element. Can anybody help?
You got some small typos, on attribute
Or, you can to do something like:
SectionId: id="1.1" ItemId: id="1.1.1" ItemId: id="1.1.2" ItemId: id="1.1.3" SectionId: id="1.2" ItemId: id="1.2.1" ItemId: id="1.2.2"