日期:2014-05-20 浏览次数:20830 次
<?xml version='1.0' encoding='UTF-8'?> <result status="ok"> <order id="5141" orderNo="jpa110506120442266" allPrice="1379" status="CANCEL_OK" contact="刘畅如苑" contactMob="15910399872" contactEmail="" payStatus="0" createTime="2011-05-06 12:04:42.0" needPS="true"><flight code="CA1860" cabin="W" dep="LZH" arr="PEK" depDay="2011-05-09" depTime="15:35" arrTime="18:45" pnr="JEZ8EZ" cpnr="" realCode="" viewPrice="1180" price="1179.0" constructionFee="50" fuelTax="110" childFuelTax="60" policyType="SP"/><passenger name="刘畅如苑" ageType="0" cardType="NI" cardNum="450204198807020624" eticketNum="" insuranceCount="1" insuranceNo=""/><log operator="System" time="2011-05-06 13:07:32.0" action="将超时订单自动删除"/><log operator="彭松" time="2011-05-06 12:06:29.0" action="修改订单,将【订单状态】由【等待座位确认】修改为【订座成功等待支付】;"/><log operator="System" time="2011-05-06 12:05:11.0" action="PATA校验异常,原因:无价格,PATA为没有符合条件的运价, 请使用手工处理 b。将订单状态改为【等待座位确认】"/><log operator="System" time="2011-05-06 12:04:44.0" action="创建订单!"/></order></result>
XElement xml = XElement.Load("../../tts.xml"); var result = from t in xml.Descendants("result") select new { status=t.Attribute("status").Value }; if (result!=null && result.Count()>0 && result.First().status=="ok") {...}