asp解析XML数据,在线等
 <FD CityPair="TYNCTU" Date="22SEP16" Airline="CA" TPM = "1173"><ACA><P Date = "27MAR16">3350.00</P><F Date = "27MAR16">3100.00</F><A Date = "27MAR16">2730.00</A><J Date = "27MAR16">2480.00</J><C Date = "27MAR16">1860.00</C><D Date = "27MAR16">1610.00</D><G Date = "27MAR16">1240.00</G><Y Date = "27MAR16">1240.00</Y><B Date = "10AUG16">1140.00</B><M Date = "10AUG16">1120.00</M><M1 Date = "10AUG16">1080.00</M1><U Date = "10AUG16">1020.00</U><U1 Date = "10AUG16">990.00</U1><H Date = "10AUG16">950.00</H><H1 Date = "10AUG16">930.00</H1><Q Date = "10AUG16">890.00</Q><Q1 Date = "10AUG16">830.00</Q1><V Date = "10AUG16">770.00</V><V1 Date = "10AUG16">710.00</V1><W Date = "10AUG16">640.00</W><S Date = "27MAR16">560.00</S><S1 Date = "27MAR16">500.00</S1></ACA></FD>
‘-----------------------------------------------------------------------

 Set xmlDOC = server.CreateObject("MSXML2.DOMDocument")'创建对象
    Response.CharSet="gb2312"
    xmlDOC.load(xmlhttp.responseXML)
    Set objNodeList = xmlDOC.getElementsByTagName("return")
    Set xmlDOC1 = server.CreateObject("MSXML2.DOMDocument")'创建对象
    xmlDOC1.LoadXml(objNodeList(0).Text)

    Set FDList = xmlDOC1.getElementsByTagname("FD")
    Response.Write "<br />"&FDList.item(0).Attributes.getNamedItem("CityPair").Text
    Response.Write "<br />"&FDList.item(0).Attributes.getNamedItem("Date").Text
    Response.Write "<br />"&FDList.item(0).Attributes.getNamedItem("Airline").Text
    FD属性都能获得,就是<aca>...</aca>这部份获取不到,不知道怎么写

例:640.00获取到W,10AUG16,640这三项数据

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问