How to Get XML Second Child

Darian Knight

New Member
Can someone help me to get the second child of the following xml:\[code\]<item><ApplicationData>881030.B.0000</ApplicationData><AutoPay>false</AutoPay><BuyerProtection>ItemEligible</BuyerProtection><BuyItNowPrice currencyID="USD">0.0</BuyItNowPrice><Country>US</Country><Currency>USD</Currency><GiftIcon>0</GiftIcon><HitCounter>RetroStyle</HitCounter><ItemID></ItemID><ListingDetails> <Adult>false</Adult> <BindingAuction>false</BindingAuction> <CheckoutEnabled>true</CheckoutEnabled> <ConvertedBuyItNowPrice currencyID="USD">0.0</ConvertedBuyItNowPrice> <ShippingServiceOptions> <ShippingService>UPSGround</ShippingService> <ShippingServiceCost currencyID="USD">9.99</ShippingServiceCost> </ShippingServiceOptions> <InternationalShippingServiceOption> <ShippingService>StandardInternational</ShippingService> <ShippingServiceCost currencyID="USD">39.99</ShippingServiceCost> </InternationalShippingServiceOption><item>\[/code\]I'm using a for look to cycle through all of the items (for $items as $item). I need to get the ShippingServiceCost from ShippingServiceOptions and InternationalShippingServiceOption.I want to do the following but it doesn't work:\[code\]//for ShippingServiceOptions$item->getElementsByTagName('ShippingServiceCost')->item(0)->nodeValue;//for InternationalServiceOptions$item->getElementsByTagName('ShippingServiceCost')->item(1)->nodeValue;\[/code\]
 
Back
Top