ownerDocument); $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'); $this->MerchantId = (string) $xpath->query('./az:Merchant/az:MerchantId/text()', $dom)->item(0)->data; $name = $xpath->query('./az:Merchant/az:Name/text()', $dom); if ($name->length == 1) { $this->MerchantName = (string) $name->item(0)->data; } $this->GlancePage = (string) $xpath->query('./az:Merchant/az:GlancePage/text()', $dom)->item(0)->data; $this->Condition = (string) $xpath->query('./az:OfferAttributes/az:Condition/text()', $dom)->item(0)->data; $this->OfferListingId = (string) $xpath->query('./az:OfferListing/az:OfferListingId/text()', $dom)->item(0)->data; $Price = $xpath->query('./az:OfferListing/az:Price/az:Amount', $dom); if ($Price->length == 1) { $this->Price = (int) $xpath->query('./az:OfferListing/az:Price/az:Amount/text()', $dom)->item(0)->data; $this->CurrencyCode = (string) $xpath->query('./az:OfferListing/az:Price/az:CurrencyCode/text()', $dom)->item(0)->data; } $availability = $xpath->query('./az:OfferListing/az:Availability/text()', $dom)->item(0); if($availability instanceof DOMText) { $this->Availability = (string) $availability->data; } $result = $xpath->query('./az:OfferListing/az:IsEligibleForSuperSaverShipping/text()', $dom); if ($result->length >= 1) { $this->IsEligibleForSuperSaverShipping = (bool) $result->item(0)->data; } } }