Im having trouble reading attribute strings while using XmlDocument to read thro child nodes. To be more specific, im trying to read an XML containing a list of running processes:
<Process_List>
<Processes>
<ibmpmsvc ID_1="860" />
<svchost ID_2="8616" />
<chrome ID_4="4300" />
<SearchIndexer ID_5="3868" />
<smss ID_6="416" />
</processes>
</Process_List>
Each start element presents a running process along with its ID (and some other stuff later on).
So Im using XmlDocument to read thro each child node of /Process_List/Processes:
XmlNodeList xnList = xml.SelectNodes("/Process_List/Processes");
foreach (XmlNode xn in xnList)
{
XmlNodeList cxnList = xn.ChildNodes;
foreach (XmlNode child in cxnList)
{
listProc1.Add(child.Name.ToString());
}
}
Problem is, Im only getting the child's name, (ibmpmsvc, svchost , chrome) and can't figure out how to get its other attributes.
thanks!