O
Open Galaxy
Guest
I have an XML that looks like the xml below:
How do I get the last node?
I do not want to pass an ID but rather just get the element that is last for color.
I am doing something like this but it relies on the ID:
List<XElement> node = (from el in exampleParent.Descendants("red")
where el.Element("id").Value == "3"
select ed).ToList();
<color>
<red id="1">
</red>
<red id="2">
</red>
<red id="3">
</red>
</color>
Continue reading...
How do I get the last node?
I do not want to pass an ID but rather just get the element that is last for color.
I am doing something like this but it relies on the ID:
List<XElement> node = (from el in exampleParent.Descendants("red")
where el.Element("id").Value == "3"
select ed).ToList();
<color>
<red id="1">
</red>
<red id="2">
</red>
<red id="3">
</red>
</color>
Continue reading...