Extract element from XML received in an Amazon SQS queue using PHP

Viewed 35

I am new to AWS SQS with PHP - on the queues body message it receives XML. I want to get a specific value from the XML result message body. How do I do it?

Say this XML below

<?xml version="1.0" encoding="UTF-8"?>
<PackMan>   
      <Line>
         <LineNumber>2</LineNumber>
         <ItemCode>DP-ATX-MTREXX50-AR-4F-NE</ItemCode>
         <Barcode>DP-ATX-MTREXX50-AR-4F-NE</Barcode>
         <ItemDescription>Deepcool Matrexx 50 ADD RGBx4</ItemDescription>
         <QuantityShipped>1</QuantityShipped>
      </Line>
      <PackWeight>2</PackWeight>
      <PackCubic>0.02</PackCubic>
   </Pack>
   <JobAttribute>
      <Attribute>NumTrack</Attribute>
      <Value>RU00001</Value>
   </JobAttribute>
</PackMan>

I want to echo the Value. How should I do it?

0 Answers
Related