question

altshop-net avatar image
0 Likes"
altshop-net asked ·

2 Questions about XML returns

Hi, I have 2 questions and I hope somebody can help me out. 1. I keep getting a "Notice: Trying to get property of non-object" for 2 items I call. This is the code where the errors originate. $Order = $responseDoc->getElementsByTagName('Order'); foreach ($Order as $ord) { $ShippingServiceSelected = $ord->getElementsByTagName('ShippingServiceSelected'); foreach ($ShippingServiceSelected as $ship) { $ShippingService = $ship->getElementsByTagName('ShippingService'); $ShippingService = $ShippingService->item(0)->nodeValue; echo $ShippingService . '
'; $ShippingServiceCost = $ship->getElementsByTagName('ShippingServiceCost'); $ShippingServiceCost = $ShippingServiceCost->item(0)->nodeValue; echo $ShippingServiceCost . '
'; }} The errors are given for the lines, $ShippingService = $ShippingService->item(0)->nodeValue; and $ShippingServiceCost = $ShippingServiceCost->item(0)->nodeValue; It gives me the correct answers, but at the same time it comes up with the notice call. Would anybody know why this is? I cannot find an answer online. 1. in the line that is returned from eBay you sometimes have an id, like here: 0.0 so in this case the currencyID. Does anybody know how to call the value (ie, AUD) for this? Thank you very much for your help. Peter
getordersgetorders-ebay-api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

altshop-net avatar image
0 Likes"
altshop-net answered ·
Thank you so much forcehighorel, that works a treat. Much obliged. Peter
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

forcehighorel avatar image
0 Likes"
forcehighorel answered ·
Hi I don't find these board that active, I been waiting about 3 days for my question to show up, anyway, I'm not sure what language your developing with but it should be some like: $AdjustmentAmoun t= $ship->getElementsByTagName('AdjustmentAmount'); $currencyID = $AdjustmentAmount->item(0)->getAttribute( 'currencyID' ); I hope this helps
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

altshop-net avatar image
0 Likes"
altshop-net answered ·
Anybody out there with a helping hand?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.