I've the below XML:
<?xml version="1.0" standalone="yes"?>
<TestSuite>
<TestCase Name="XXX" ID="123;234; 345; 456">
<CodeBlock />
</TestCase>
<TestCase Name="East" ID="11,22,33, 44, 55">
<CodeBlock />
</TestCase>
</TestSuite>
I need to get all the ID and order them by ID ASC, below is my Linq:
var r = (from lv1 in xdoc.Descendants("TestCase")
select new { ID = lv1.Attribute("ID").Value })
.Where(d => d.ID != string.Empty)
.GroupBy(l => l.ID)
.ToList();
I now get:
123;234; 345; 456
11,22,33, 44, 55
But how can I get the IDs like:
11
22
33
44
55
123
234
345
456