webmasterbeta
New Member
Would someone mind helping me?
I don't know very much about XML but I've got to learn as I need to parse the attached file using perl.
As one can see the values are on multi levels so I'm a little lost as how to retrieve them. Would it be possible that XML::Simple would do the job?
Any help would be appreciated!
-Mike
Here's the xml file:
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
xmlns:saml="urnasis:names:tc:SAML:1.0:assertion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
xmlns:ns="urn:ebay:apiayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
<RequesterCredentials xmlns="urn:ebay:apiayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"/>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetTransactionDetailsResponse xmlns="urn:ebay:apiayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2004-10-14T18:49:05Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">1.000000</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
<PaymentTransactionDetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="eblaymentTransactionType">
<ReceiverInfo xsi:type="ebl:ReceiverInfoType">
<Business xsi:type="ebl:EmailAddressType">[email protected]</Business>
<Receiver xsi:type="ebl:EmailAddressType">[email protected]</Receiver>
<ReceiverID xsi:type="ebl:UserIDType">Q6PK32Z5ZSX2S</ReceiverID>
</ReceiverInfo>
<PayerInfo xsi:type="eblayerInfoType">
<Payer xsi:type="ebl:EmailAddressType">[email protected]</Payer>
<PayerID xsi:type="ebl:UserIDType">RRJPLTMFCREJQ</PayerID>
<PayerStatus xsi:type="eblayPalUserStatusCodeType">verified</PayerStatus>
<PayerName xsi:type="eblersonNameType">
<FirstName xsi:type="ebl:NameType">Dave</FirstName>
<LastName xsi:type="ebl:NameType">Burchell</LastName>
</PayerName>
<PayerCountry xsi:type="ebl:CountryCodeType">US</PayerCountry>
<PayerBusiness xsi:type="xs:string"/>
<Address xsi:type="ebl:AddressType">
<Name xsi:type="xs:string"/>
<Street1 xsi:type="xs:string"/>
<Street2 xsi:type="xs:string"/>
<CityName xsi:type="xs:string"/>
<StateOrProvince xsi:type="xs:string"/>
<CountryName/>
<PostalCode xsi:type="xs:string"/>
<AddressOwner xsi:type="ebl:AddressOwnerCodeType">PayPal</AddressOwner>
<AddressStatus xsi:type="ebl:AddressStatusCodeType">None</AddressStatus>
</Address>
</PayerInfo>
<PaymentInfo xsi:type="eblaymentInfoType">
<TransactionID>2H21140808310442T</TransactionID>
<ParentTransactionID xsi:type="ebl:TransactionId"/>
<ReceiptID/>
<TransactionType xsi:type="eblaymentTransactionCodeType">send-money</TransactionType>
<PaymentType xsi:type="eblaymentCodeType">instant</PaymentType>
<PaymentDate xsi:type="xs:dateTime">2004-05-26T22:01:56Z</PaymentDate>
<GrossAmount xsi:type="cc:BasicAmountType" currencyID="USD">1.00</GrossAmount>
<FeeAmount xsi:type="cc:BasicAmountType" currencyID="USD">0.33</FeeAmount>
<ExchangeRate xsi:type="xs:string"/>
<PaymentStatus xsi:type="eblaymentStatusCodeType">Refunded</PaymentStatus>
<PendingReason xsi:type="eblendingStatusCodeType">none</PendingReason>
<ReasonCode xsi:type="ebl:ReversalReasonCodeType">none</ReasonCode>
</PaymentInfo>
<PaymentItemInfo xsi:type="eblaymentItemInfoType">
<InvoiceID xsi:type="xs:string"/>
<Custom xsi:type="xs:string"/>
<Memo xsi:type="xs:string"/>
<SalesTax xsi:type="xs:string"/>
<PaymentItem
xmlns="urn:ebay:apis:eBLBaseComponents"
xsi:type="eblaymentItemType">
<Name xsi:type="xs:string"/>
<Number xsi:type="xs:string"/>
<Quantity xsi:type="xs:string"/>
<SalesTax xsi:type="xs:string"/>
</PaymentItem>
<Subscription xsi:type="ebl:SubscriptionInfoType" recurring="" reattempt="">
<SubscriptionID/>
<Username xsi:type="xs:string"/>
<Password xsi:type="xs:string"/>
<Recurrences xsi:type="xs:string"/>
</Subscription>
<Auction xsi:type="ebl:AuctionInfoType" multiItem="">
<BuyerID xsi:type="xs:string"/>
</Auction>
</PaymentItemInfo>
</PaymentTransactionDetails>
</GetTransactionDetailsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I don't know very much about XML but I've got to learn as I need to parse the attached file using perl.
As one can see the values are on multi levels so I'm a little lost as how to retrieve them. Would it be possible that XML::Simple would do the job?
Any help would be appreciated!
-Mike
Here's the xml file:
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cc="urn:ebay:apis:CoreComponentTypes"
xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
xmlns:saml="urnasis:names:tc:SAML:1.0:assertion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
xmlns:ebl="urn:ebay:apis:eBLBaseComponents"
xmlns:ns="urn:ebay:apiayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"/>
<RequesterCredentials xmlns="urn:ebay:apiayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"/>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetTransactionDetailsResponse xmlns="urn:ebay:apiayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2004-10-14T18:49:05Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">1.000000</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">1.0006</Build>
<PaymentTransactionDetails xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="eblaymentTransactionType">
<ReceiverInfo xsi:type="ebl:ReceiverInfoType">
<Business xsi:type="ebl:EmailAddressType">[email protected]</Business>
<Receiver xsi:type="ebl:EmailAddressType">[email protected]</Receiver>
<ReceiverID xsi:type="ebl:UserIDType">Q6PK32Z5ZSX2S</ReceiverID>
</ReceiverInfo>
<PayerInfo xsi:type="eblayerInfoType">
<Payer xsi:type="ebl:EmailAddressType">[email protected]</Payer>
<PayerID xsi:type="ebl:UserIDType">RRJPLTMFCREJQ</PayerID>
<PayerStatus xsi:type="eblayPalUserStatusCodeType">verified</PayerStatus>
<PayerName xsi:type="eblersonNameType">
<FirstName xsi:type="ebl:NameType">Dave</FirstName>
<LastName xsi:type="ebl:NameType">Burchell</LastName>
</PayerName>
<PayerCountry xsi:type="ebl:CountryCodeType">US</PayerCountry>
<PayerBusiness xsi:type="xs:string"/>
<Address xsi:type="ebl:AddressType">
<Name xsi:type="xs:string"/>
<Street1 xsi:type="xs:string"/>
<Street2 xsi:type="xs:string"/>
<CityName xsi:type="xs:string"/>
<StateOrProvince xsi:type="xs:string"/>
<CountryName/>
<PostalCode xsi:type="xs:string"/>
<AddressOwner xsi:type="ebl:AddressOwnerCodeType">PayPal</AddressOwner>
<AddressStatus xsi:type="ebl:AddressStatusCodeType">None</AddressStatus>
</Address>
</PayerInfo>
<PaymentInfo xsi:type="eblaymentInfoType">
<TransactionID>2H21140808310442T</TransactionID>
<ParentTransactionID xsi:type="ebl:TransactionId"/>
<ReceiptID/>
<TransactionType xsi:type="eblaymentTransactionCodeType">send-money</TransactionType>
<PaymentType xsi:type="eblaymentCodeType">instant</PaymentType>
<PaymentDate xsi:type="xs:dateTime">2004-05-26T22:01:56Z</PaymentDate>
<GrossAmount xsi:type="cc:BasicAmountType" currencyID="USD">1.00</GrossAmount>
<FeeAmount xsi:type="cc:BasicAmountType" currencyID="USD">0.33</FeeAmount>
<ExchangeRate xsi:type="xs:string"/>
<PaymentStatus xsi:type="eblaymentStatusCodeType">Refunded</PaymentStatus>
<PendingReason xsi:type="eblendingStatusCodeType">none</PendingReason>
<ReasonCode xsi:type="ebl:ReversalReasonCodeType">none</ReasonCode>
</PaymentInfo>
<PaymentItemInfo xsi:type="eblaymentItemInfoType">
<InvoiceID xsi:type="xs:string"/>
<Custom xsi:type="xs:string"/>
<Memo xsi:type="xs:string"/>
<SalesTax xsi:type="xs:string"/>
<PaymentItem
xmlns="urn:ebay:apis:eBLBaseComponents"
xsi:type="eblaymentItemType">
<Name xsi:type="xs:string"/>
<Number xsi:type="xs:string"/>
<Quantity xsi:type="xs:string"/>
<SalesTax xsi:type="xs:string"/>
</PaymentItem>
<Subscription xsi:type="ebl:SubscriptionInfoType" recurring="" reattempt="">
<SubscriptionID/>
<Username xsi:type="xs:string"/>
<Password xsi:type="xs:string"/>
<Recurrences xsi:type="xs:string"/>
</Subscription>
<Auction xsi:type="ebl:AuctionInfoType" multiItem="">
<BuyerID xsi:type="xs:string"/>
</Auction>
</PaymentItemInfo>
</PaymentTransactionDetails>
</GetTransactionDetailsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>