Jag behöver plocka ut consignmentId och orderNo från nedan XML. Men jag får inte till det.
XML:
Det börjar ju med
Sedan har jag provat flera sätt men inget funkar för mig. Bl.a:
Förslag?
XML:
Kod:
<?xml version='1.0' encoding='UTF-8'?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns4:bookResponse xmlns:ns2="http://www.x.com/consignment/types/v1_0" xmlns:ns3="http://www.x.com/common/webservice/types/v1_0" xmlns:ns4="http://www.x.com/consignment/types"> <result> <consignments consignmentId="137600459735850de1903" orderNo="fe990255">
Kod:
Dim xmlDoc, fil set xmlDoc=Server.CreateObject("Msxml2.DOMDocument.4.0") xmlDoc.async="false" fil=Server.mappath("testa.xml") xmlDoc.load(fil) Dim root Set root = xmlDoc.documentElement
Kod:
Set objNamedNodeMap = xmlDoc.documentElement.childNodes(4) intConsignmentId = objNamedNodeMap.attributes.getNamedItem("consignmentId").text response.write intConsignmentId
Kommentera