高手请进,在线等待解决问题,急急
如何解析从顺风快递查询WebServices的数据。数据格式如下:
<?xml version='1.0' encoding='UTF-8' ?>
<response service="RouteService"><Head>OK</Head><Body>
<RouteResponse mailno="106119552844">
<Route remark="正在派件.." accept_time="2013-08-07 09:43:24" accept_address="深圳市" opcode="44"/>
<Route remark="正在派件.." accept_time="2013-08-27 15:19:47" accept_address="深圳市" opcode="44"/>
<Route remark="正在派件.." accept_time="2013-08-28 10:06:47" accept_address="深圳市" opcode="44"/>
</RouteResponse>
最好能将其解析为数据或其他,方便页面显示
[解决办法]
这一句话能说的清楚就好了,一般用XmlDocument写几个列子就明白了
private Boolean add(string name,string path)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("db/video.xml"));
XmlNodeList list = xmlDoc.SelectNodes("root/node");
XmlElement root = xmlDoc.CreateElement("node");
XmlNode info = xmlDoc.SelectSingleNode("root/info");
int newId=int.Parse(info.Attributes["maxid"].Value)+1;
//root.SetAttribute("id", (list.Count + 1).ToString());
root.SetAttribute("id", newId.ToString());
root.SetAttribute("name", name);
root.SetAttribute("path", path);
xmlDoc.DocumentElement.AppendChild(root);
info.Attributes["maxid"].Value = newId.ToString();
xmlDoc.Save(Server.MapPath("db/video.xml"));
return true;
}
[解决办法]
http://www.cnblogs.com/xiaoxiangfeizi/archive/2011/07/29/2120807.html
[解决办法]
补充资料