Hi
Need some assistance into how i can retrieve values from the following XML file that has been generated from a webservice call. The returned file data structure is as follows
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
soap:Body
<_currency>£</_currency>1234564Test Carrier1ZONE 1531/03/2021GBP20210331[none]100.1Piece1010025MEXICO Swivel Chair, blackZONE 10.000.000.000.000.000.000.000.00An Applicable rate could not be found!Unable to determine Geo LocationTESTStation Road, 21CambridgeCambridgeshireCB1 2FBUNITED KINGDOM0,0TEST RECEIVER9999123123597122 South Ashford StreetLondonGreater LondonW2 8HGUNITED KINGDOM0,0SENDER NAMEPARCEL200.000.000.10.00100.000.000.005
</soap:Body>
</soap:Envelope>
The value i need to retrieve is X. I tried to implement the following function/procedure to try and return me the value however i am just getting a blank.
TotalCost := Getfield(Result, ‘/Body/CalculateRateResponse/CalulateRateResult/Connote/totalcost’) Result being the XML document containing the above data.
Procedure Getfield(var XMLD: XMLDocument, Path: Text) : Text
begin
if XmlD.SelectSingleNode(Path, N) then
exit(N.AsXmlElement().InnerText);
end;
Any assistance or advise as to what i am doing incorrectly or how to resolve would be greatly appreciated.
Regards
Gurn