Hi
I have an XML of this format.
<?xml version="1.0" encoding="utf-8"?>
<Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<A>
<B>
<SH>
<last_update_time>2015-02-26</last_update_time>
<D></D>
<comments>Monitor</comments>
</SH>
<SH>
<last_update_time>2015-02-27</last_update_time>
<D>YYY</D>
<comments>Printer</comments>
</SH>
</B>
</A>
</Body>
I want to populate a list as
2015-02-26, XXX,Monitor
2015-02-27, YYY, Printer
In my code (C# - Winform) I have composed as below.
XmlNodeList xNode = xd.SelectNodes("/Body/A/B/SH");
foreach (XmlNode xndNode in xNode)
{
string LU = xndNode["last_update_time"].InnerText;
string D = xndNode["D"].InnerText;
string Comments = xndNode["comments"].InnerText;
}
Yet, I am not able to get the desired output. Any help where I have gone wrong, please.