问题描述
DOMDocumentdom=newDOMDocument();dom.load(Retrieval.responseXML);IXMLDOMNodeListxnl=dom.documentElement.selectNodes("//ns2:xxxx");DataTabletable=newDataTable();inti=0;foreach(IXMLDOMElementelementinxnl){//判断父节点是否为指定节点if(i!=0){IXMLDOMNodeListxx2=xnl[i].selectNodes("//2222");Response.Write(xx2[0].selectSingleNode("ticketLeft").text);Response.Write(element.selectSingleNode("companyShow").text+"<br>");}i++;}部分XML如下<ns2:Flightxmlns:ns2="http://fly.ticket.ky.zgyt.com"><build_feexmlns="http://fly.ticket.ky.zgyt.com">0.0</build_fee>-<bunkxmlns="http://fly.ticket.ky.zgyt.com">-<BunkSeat><discountRate>100</discountRate><moneyType>元(¥)</moneyType><price>2410.00</price><rank>Y</rank><rankShow>标准经济舱</rankShow><return_rate>2.5</return_rate><ticketLeft>大于9</ticketLeft></BunkSeat></bunk><cityFromxmlns="http://fly.ticket.ky.zgyt.com">PEK</cityFrom><cityFromShowxmlns="http://fly.ticket.ky.zgyt.com">B北京首都(PEK)</cityFromShow></ns2:Flight>
解决方案
解决方案二:
??????????一次response.write