XmlDocument 嵌套使用心法
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(strXml);
XmlNodeList x = xmlDoc.SelectNodes("/NETBOX/RESPONSE/DETAILS/PERSONID");
for (int i = 0; i < x.Count; i++)
{
// MessageBox.Show(x.Item(i).NextSibling.NextSibling.InnerXml);
XmlDocument xmlDocN = new XmlDocument();
string strXmlAccessS = x.Item(i).NextSibling.NextSibling.InnerXml;
strXmlAccessS = "<ROOT>" + strXmlAccessS + "</ROOT>";
xmlDocN.LoadXml(strXmlAccessS);
XmlNodeList dttm = xmlDocN.SelectNodes("/ROOT/ACCESS/DTTM");
for (int j = dttm.Count - 1; j >= 0 ; j--)
{
Item it = new Item();
if (j == dttm.Count - 1)
{
it.bChangeFlag = true;
}
it.strPERSONID = x.Item(i).InnerXml;
it.strDTTM = dttm.Item(j).InnerText;
AddItem(it);
}
}