03-06-2020, Saat: 21:50
Arkadaşlar merhaba, Elimde aşağıdaki bir xml dosyası var. Yapmak istediğim herhangi bir node içindeki bir bilgiye ulaşmak. Ancak aşağıdaki kod ile accesviolation hatası alıyorum. Nerede yanlış yapıyor olabilirim.
xml dosyam
var xml:Tstringlist; sign:string; Node, AltNode: IXMLNode; XMLNode: IXMLNode; begin xmldoc.Active:=false; xmldoc.loadfromfile :=dosyayolu; xmldoc.Active:=true; Node := xmldoc.DocumentElement; AltNode := Node.ChildNodes.FindNode('buyerInfo'); repeat showmessage(AltNode.ChildNodes['username'].Text); AltNode := AltNode.NextSibling; until AltNode = nil; end;
xml dosyam
<?xml version="1.0"?> -<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> -<env:Body> -<sale:getSalesResponse xmlns:sale="http://sale.individual.ws.listingapi.gg.com"> -<return> <ackCode>success</ackCode> <responseTime>30/05/2020 23:12:13</responseTime> <timeElapsed>114 ms</timeElapsed> <saleCount>1</saleCount> -<sales> -<sale> <saleCode>SC63188551</saleCode> <status>durum</status> <statusCode>STATUS_APPROVED</statusCode> <productId>323683305</productId> <productTitle>ürün bilgisi</productTitle> <price>220.0</price> <cargoPayment>Satıcı Öder</cargoPayment> <cargoCode>kargokodu</cargoCode> <amount>1</amount> <endDate>11/11/2018 15:42:31</endDate> -<buyerInfo> <username>*****</username> <name>******</name> <surname>*****</surname> <phone>********</phone> <mobilePhone>*****</mobilePhone> <address>******</address> <district>****</district> <city>*****</city> +<neighborhoodType> <zipCode>*****</zipCode> </buyerInfo> <thumbImageLink>******</thumbImageLink> <lastActionDate>19/11/2018 14:55:20</lastActionDate> <variantId>0</variantId> <moneyDate>09/11/2018 21:38:24</moneyDate> +<shippingInfo> </sale> </sales> <nextPageAvailable>true</nextPageAvailable> </return> </sale:getSalesResponse> </env:Body> </env:Envelope>