This question already has an answer here:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<response status="200">
<meta>
<start>0</start>
<end>50</end>
<total>5</total>
</meta>
<DerivedStatus>HandedovertoCourier</DerivedStatus>
<OrderList>
<OrderSummary>
<OrderId>10676867</OrderId>
<TransactionId>21799947</TransactionId>
<ProductID>13213708</ProductID>
<ProductSKU>
<![CDATA[ 13213708 ]]>
</ProductSKU>
<VendorSKU>
<![CDATA[ S14-809-ORANGE_4 ]]>
</VendorSKU>
<ProductDesc>
<![CDATA[ Karemel Orange Crape Dress XXL ]]>
</ProductDesc>
<OrderDate>10-NOV-2014 14:01:14</OrderDate>
<ShipmentDate>14-NOV-14</ShipmentDate>
<ShipmentDeliveryDate/>
<DeliveryDate/>
<PaymentDate>-</PaymentDate>
<ApprovalDate>10-NOV-14</ApprovalDate>
<ReversalDate/>
<RequestedDeliveryDate/>
<ShippingAmount>88</ShippingAmount>
<Rate>650</Rate>
<Quantity>1</Quantity>
<Shipping>
<![CDATA[ 1 ]]>
</Shipping>
<LogisticsBy>
<![CDATA[ Velocity ]]>
</LogisticsBy>
<LogisticsOrderRef>
<![CDATA[ 90000878259 ]]>
</LogisticsOrderRef>
<PaymentMethod>
<![CDATA[ CDD ]]>
</PaymentMethod>
<CustomerName>
<![CDATA[ monika - das ]]>
</CustomerName>
<CustomerPhone/>
<ShipmentCity>
<![CDATA[ CALCUTTA ]]>
</ShipmentCity>
<ShipmentPincode>700060</ShipmentPincode>
<ShipmentCountry>INDIA</ShipmentCountry>
<CostPrice>520</CostPrice>
</OrderSummary>
<OrderSummary>
<OrderId>10699355</OrderId>
<TransactionId>21823859</TransactionId>
<ProductID>13257628</ProductID>
<ProductSKU>
<![CDATA[ 13257628 ]]>
</ProductSKU>
<VendorSKU>
<![CDATA[ CX_1111_YELLOW_XL ]]>
</VendorSKU>
<ProductDesc>
<![CDATA[ Karemel Dxi Pullover Yellow _XL ]]>
</ProductDesc>
<OrderDate>15-NOV-2014 14:43:44</OrderDate>
<ShipmentDate>17-NOV-14</ShipmentDate>
<ShipmentDeliveryDate/>
<DeliveryDate/>
<PaymentDate>-</PaymentDate>
<ApprovalDate>15-NOV-14</ApprovalDate>
<ReversalDate/>
<RequestedDeliveryDate/>
<ShippingAmount>88</ShippingAmount>
<Rate>1399</Rate>
<Quantity>1</Quantity>
<Shipping>
<![CDATA[ 1 ]]>
</Shipping>
<LogisticsBy>
<![CDATA[ EcomExpress ]]>
</LogisticsBy>
<LogisticsOrderRef>
<![CDATA[ 715536954 ]]>
</LogisticsOrderRef>
<PaymentMethod>
<![CDATA[ CDD ]]>
</PaymentMethod>
<CustomerName>
<![CDATA[ pradeep - TIWARI ]]>
</CustomerName>
<CustomerPhone/>
<ShipmentCity>
<![CDATA[ BHOPAL ]]>
</ShipmentCity>
<ShipmentPincode>462046</ShipmentPincode>
<ShipmentCountry>INDIA</ShipmentCountry>
<CostPrice>1119.2</CostPrice>
</OrderSummary>
<OrderSummary>
<OrderId>10699355</OrderId>
<TransactionId>21823860</TransactionId>
<ProductID>13257641</ProductID>
<ProductSKU>
<![CDATA[ 13257641 ]]>
</ProductSKU>
<VendorSKU>
<![CDATA[ CX_1111_NAVY_XL ]]>
</VendorSKU>
<ProductDesc>
<![CDATA[ Karemel Dxi Pullover Navy _XL ]]>
</ProductDesc>
<OrderDate>15-NOV-2014 14:43:44</OrderDate>
<ShipmentDate>17-NOV-14</ShipmentDate>
<ShipmentDeliveryDate/>
<DeliveryDate/>
<PaymentDate>-</PaymentDate>
<ApprovalDate>15-NOV-14</ApprovalDate>
<ReversalDate/>
<RequestedDeliveryDate/>
<ShippingAmount>88</ShippingAmount>
<Rate>1399</Rate>
<Quantity>1</Quantity>
<Shipping>
<![CDATA[ 1 ]]>
</Shipping>
<LogisticsBy>
<![CDATA[ EcomExpress ]]>
</LogisticsBy>
<LogisticsOrderRef>
<![CDATA[ 715536955 ]]>
</LogisticsOrderRef>
<PaymentMethod>
<![CDATA[ CDD ]]>
</PaymentMethod>
<CustomerName>
<![CDATA[ pradeep - TIWARI ]]>
</CustomerName>
<CustomerPhone/>
<ShipmentCity>
<![CDATA[ BHOPAL ]]>
</ShipmentCity>
<ShipmentPincode>462046</ShipmentPincode>
<ShipmentCountry>INDIA</ShipmentCountry>
<CostPrice>1119.2</CostPrice>
</OrderSummary>
<OrderSummary>
<OrderId>10699355</OrderId>
<TransactionId>21823861</TransactionId>
<ProductID>13257663</ProductID>
<ProductSKU>
<![CDATA[ 13257663 ]]>
</ProductSKU>
<VendorSKU>
<![CDATA[ CX_3333_ROYAL BLUE_XL ]]>
</VendorSKU>
<ProductDesc>
<![CDATA[ Karemel Dxi Pullover Blue _XL ]]>
</ProductDesc>
<OrderDate>15-NOV-2014 14:43:44</OrderDate>
<ShipmentDate>17-NOV-14</ShipmentDate>
<ShipmentDeliveryDate/>
<DeliveryDate/>
<PaymentDate>-</PaymentDate>
<ApprovalDate>15-NOV-14</ApprovalDate>
<ReversalDate/>
<RequestedDeliveryDate/>
<ShippingAmount>88</ShippingAmount>
<Rate>1449</Rate>
<Quantity>1</Quantity>
<Shipping>
<![CDATA[ 1 ]]>
</Shipping>
<LogisticsBy>
<![CDATA[ EcomExpress ]]>
</LogisticsBy>
<LogisticsOrderRef>
<![CDATA[ 715536956 ]]>
</LogisticsOrderRef>
<PaymentMethod>
<![CDATA[ CDD ]]>
</PaymentMethod>
<CustomerName>
<![CDATA[ pradeep - TIWARI ]]>
</CustomerName>
<CustomerPhone/>
<ShipmentCity>
<![CDATA[ BHOPAL ]]>
</ShipmentCity>
<ShipmentPincode>462046</ShipmentPincode>
<ShipmentCountry>INDIA</ShipmentCountry>
<CostPrice>1159.2</CostPrice>
</OrderSummary>
<OrderSummary>
<OrderId>10699355</OrderId>
<TransactionId>21823862</TransactionId>
<ProductID>13257682</ProductID>
<ProductSKU>
<![CDATA[ 13257682 ]]>
</ProductSKU>
<VendorSKU>
<![CDATA[ CX_3333_GRASS GREEN_XL ]]>
</VendorSKU>
<ProductDesc>
<![CDATA[ Karemel Dxi Pullover Grass Green _XL ]]>
</ProductDesc>
<OrderDate>15-NOV-2014 14:43:44</OrderDate>
<ShipmentDate>17-NOV-14</ShipmentDate>
<ShipmentDeliveryDate/>
<DeliveryDate/>
<PaymentDate>-</PaymentDate>
<ApprovalDate>15-NOV-14</ApprovalDate>
<ReversalDate/>
<RequestedDeliveryDate/>
<ShippingAmount>88</ShippingAmount>
<Rate>1449</Rate>
<Quantity>1</Quantity>
<Shipping>
<![CDATA[ 1 ]]>
</Shipping>
<LogisticsBy>
<![CDATA[ EcomExpress ]]>
</LogisticsBy>
<LogisticsOrderRef>
<![CDATA[ 715536957 ]]>
</LogisticsOrderRef>
<PaymentMethod>
<![CDATA[ CDD ]]>
</PaymentMethod>
<CustomerName>
<![CDATA[ pradeep - TIWARI ]]>
</CustomerName>
<CustomerPhone/>
<ShipmentCity>
<![CDATA[ BHOPAL ]]>
</ShipmentCity>
<ShipmentPincode>462046</ShipmentPincode>
<ShipmentCountry>INDIA</ShipmentCountry>
<CostPrice>1159.2</CostPrice>
</OrderSummary>
</OrderList>
</response>
My code to parse :-
$responseDoc = new DOMDocument();
$responseDoc->loadXML($response);
$response = simplexml_import_dom($responseDoc);
echo "<pre>";
print_r($response);
echo "</pre>";
But it returns :
SimpleXMLElement Object
(
[@attributes] => Array
(
[status] => 200
)
[meta] => SimpleXMLElement Object
(
[start] => 0
[end] => 50
[total] => 6
)
[DerivedStatus] => HandedovertoCourier
[OrderList] => SimpleXMLElement Object
(
[OrderSummary] => Array
(
[0] => SimpleXMLElement Object
(
[OrderId] => 10649716
[TransactionId] => 21771295
[ProductID] => 13273979
[ProductSKU] => SimpleXMLElement Object
(
)
[VendorSKU] => SimpleXMLElement Object
(
)
[ProductDesc] => SimpleXMLElement Object
(
)
[OrderDate] => 03-NOV-2014 21:42:03
[ShipmentDate] => 08-NOV-14
[ShipmentDeliveryDate] => SimpleXMLElement Object
(
)
[DeliveryDate] => SimpleXMLElement Object
(
)
[PaymentDate] => -
[ApprovalDate] => 03-NOV-14
[ReversalDate] => SimpleXMLElement Object
(
)
[RequestedDeliveryDate] => SimpleXMLElement Object
(
)
[ShippingAmount] => 49
[Rate] => 750
[Quantity] => 1
[Shipping] => SimpleXMLElement Object
(
)
[LogisticsBy] => SimpleXMLElement Object
(
)
[LogisticsOrderRef] => SimpleXMLElement Object
(
)
[PaymentMethod] => SimpleXMLElement Object
(
)
[CustomerName] => SimpleXMLElement Object
(
)
[CustomerPhone] => SimpleXMLElement Object
(
)
[ShipmentCity] => SimpleXMLElement Object
(
)
[ShipmentPincode] => 755028
[ShipmentCountry] => INDIA
[CostPrice] => 600
)
As you all can see [ProductSKU] => SimpleXMLElement Object show empty. How can I display that data ?
No comments:
Post a Comment