XmlNodeList VoteItem = root.SelectNodes("VoteDescirption");
foreach (XmlNode xn in VoteItem)
{
XmlElement xe = (XmlElement)xn;
if (xe.GetAttribute("voteID") == "2010102104")
{
xe.AppendChild(newVoteItem);
this.saveDocument();
}
}
我要查找某个节点,然后在此节点下面添加新的子节点,但是每次运行到这个foreach语句后就跳过去了,请大侠帮个忙?
foreach (XmlNode xn in VoteItem)
{
XmlElement xe = (XmlElement)xn;
if (xe.GetAttribute("voteID") == "2010102104")
{
xe.AppendChild(newVoteItem);
this.saveDocument();
}
}
我要查找某个节点,然后在此节点下面添加新的子节点,但是每次运行到这个foreach语句后就跳过去了,请大侠帮个忙?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货