我有以下格式的xml:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<draw><drawNo>381555</drawNo>
<drawTime>2013-04-29T19:55:00+03:00</drawTime>
<result>8</result>
<result>10</result>
<result>13</result>
<result>15</result>
<result>20</result>
<result>21</result>
<result>22</result>
<result>25</result>
<result>28</result>
<result>29</result>
<result>34</result>
<result>36</result>
<result>44</result>
<result>46</result>
<result>52</result>
<result>62</result>
<result>63</result>
<result>72</result>
<result>73</result>
<result>75</result>
</draw>
我需要拆分数据...我尝试了以下代码:
XDocument loadeddata = XDocument.Parse(e.Result);
var data = from query in loadeddata.Descendants("draw")
select new KinnoResults()
{
DrawNo = (String) query.Element("drawNo").Value,
DrawTime = (String) query.Element("drawTime").Value,
result1 = (String)query.Element("result").Value,
result2 = (String)query.Element("result").Value
};
List<KinnoResults> list = data.ToList();
但是 result1 和 result2 具有相同的值 8。请问有什么想法吗?