I'm new to Delphi and am having trouble loading an XML document from a string. It does not make any mistake, it just does not load, it makes me think that I must be making some pretty silly mistake.
My code is this:
var
lHTTP: TIdHTTP;
Result: String;
doc: TXMLDocument;
alipay: IXMLNodeList;
begin
lHTTP := TIdHTTP.Create;
doc := TXMLDocument.Create(nil);
try
Result := lHTTP.Get('https://mapi.alipay.com/gateway.do? service=notify_verify&partner=002153¬ify_id=589654');
doc.LoadFromXML(Result);
doc.Active := True;
alipay := doc.ChildNodes;
finally
lHTTP.Free;
end;
end;
end.
Within the var Result returns the XML:
<?xml version="1.0" encoding="GBK"?>'#$A'<alipay><is_success>F</is_success>
<error>ILLEGAL_PARTNER</error></alipay>
Does anyone know what's going on?