I have the following xml
<?xml version="1.0" encoding="UTF-8"?>
<tests>
<testdef name="Gaps (Simple)">
<property GapInterval="null" />
<property ReturnAllOpt="null" />
</testdef>
<testdef name="Gaps (Holiday Aware)">
<property GapInterval="null" />
<property HolidayOrigin="null" />
<property ReturnAllOpt="null" />
</testdef>
I need to get the attributes of property for each of the testdef name.
List<string> values = new List<string>();
XmlNodeList valueslist = propdoc.GetElementsByTagName("testdef");
for (int i = 0; i < valueslist.Count; i++)
{
values.Add(valueslist[i].InnerXml);
Console.WriteLine(valueslist[i].InnerXml);
}
I have written the following code where I get the whole attribute of the testdef. Is there any way I can achieve my goal.