首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web Service >

,待解决有关问题,

2013-11-20 
高手请进,在线等待解决问题,急急如何解析从顺风快递查询WebServices的数据。数据格式如下:?xml version1

高手请进,在线等待解决问题,急急
如何解析从顺风快递查询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
[解决办法]
补充资料

热点排行