Hey all
I am working on Shipping module....And i have one XML script which all gives me the below output :
XML Resposne:
My question is <TotalCharges>< CurrencyCode>US D</CurrencyCode><M onetaryValue>44 .59
</MonetaryValue></TotalCharges>
In the above one , i want to store the value of that MonetaryValue which is 44.59 into one variable.....
how can i do that...
just to show , below is the XML which i have used
can you help me , how i can store the value ?
I am working on Shipping module....And i have one XML script which all gives me the below output :
XML Resposne:
Code:
<?xml version="1.0"?> <CustomerContext> Shipping1.0001 <ResponseStatusCode>1 Success</ResponseStatusDescription>03 </Code>Your invoice may vary from the displayed reference rates <Code>LBS </UnitOfMeasurement>55.0 </BillingWeight> <TransportationCharges>USD <MonetaryValue>44.59 <ServiceOptionsCharges> <CurrencyCode>USD0.00 </MonetaryValue>USD </CurrencyCode>44.59 <GuaranteedDaysToDelivery> </ScheduledDeliveryTime> USD</CurrencyCode> <MonetaryValue>44.59 <ServiceOptionsCharges>USD0.00 </MonetaryValue>USD </CurrencyCode>44.59 55.0</Weight>LBS </UnitOfMeasurement>55.0 </RatedShipment>
</MonetaryValue></TotalCharges>
In the above one , i want to store the value of that MonetaryValue which is 44.59 into one variable.....
how can i do that...
just to show , below is the XML which i have used
Code:
$this->_xml_request =<<<XML
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber></AccessLicenseNumber>
<UserId></UserId>
<Password></Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>Shipping</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>$this->_request_option</RequestAction>
<RequestOption>$this->_request_option</RequestOption>
</Request>
<PickupType>
<Code></Code>
</PickupType>
<Shipment>
<Shipper>
<ShipperNumber></ShipperNumber>
<Address>
<City></City>
<StateProvinceCode></StateProvinceCode>
<PostalCode></PostalCode>
<CountryCode></CountryCode>
</Address>
</Shipper>
<ShipTo>
<Address>
<StateProvinceCode>$state</StateProvinceCode>
<PostalCode>$postal_code</PostalCode>
<CountryCode>$country</CountryCode>
<ResidentialAddress>0</ResidentialAddress>
</Address>
</ShipTo>
<ShipFrom>
<Address>
<StateProvinceCode></StateProvinceCode >
<PostalCode></PostalCode>
<CountryCode></CountryCode>
</Address>
</ShipFrom>
<Service>
<Code></Code>
</Service>
<Package>
<PackagingType>
<Code></Code>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>$weight</Weight>
</PackageWeight>
</Package>
<RateInformation>
<NegotiatedRatesIndicator/>
</RateInformation>
</Shipment>
</RatingServiceSelectionRequest>
XML;
Comment