PHP SimpleXML problem

Hi experts,

I try to read xml data from an XML response by using  the SimpleXMLElement.
But it doesn't work. When I write the output to a file I can see the response,
but when I try to read single Elements (i.e. FunctionResult) it's always empty.

Where's the mistake?
//THE XML RESPONSE
 
<?xml version="1.0" encoding="UTF-8"?> 
<WIRECARD_BXML xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wirecard.xsd"> 
<W_RESPONSE> 
  <FNC_CC_TRANSACTION> 
    <PROCESSING_STATUS> 
      <GuWID>C888752122656993575722</GuWID>
      <AuthorizationCode></AuthorizationCode> 
      <Info>THIS IS A DEMO TRANSACTION </Info> 
      <StatusType>INFO</StatusType> 
      <FunctionResult>NOK</FunctionResult> 
      <ERROR> 
        <Type>DATA_ERROR</Type> 
        <Number>20071</Number> 
        <Message>Expiration date invalid.</Message> 
        <Advice>Expiration date must not be exceeded.</Advice> 
       </ERROR> 
     </PROCESSING_STATUS> 
   </FNC_CC_TRANSACTION>  
 </W_RESPONSE> 
</WIRECARD_BXML>
 
//MY PHP Script (outpou
	  $xml = new SimpleXMLElement($output);
	  
	  $processingResult = $xml -> xpath('//PROCESSING_STATUS');
	  $isError = $processingResult -> FunctionResult;
	  
	  $errorMessage = "";
	  $errorAdvice = "";
	  
	  echo "isError".$isError; //echo just displays "isError" 
                                   //($isError seems to be empty)
 
<TimeStamp>2008-11-13 10:52:15</TimeStamp>

Open in new window

arthrexAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Roger BaklundCommented:
Try this:
$isError = $processingResult[0] -> FunctionResult;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Roger BaklundCommented:
Did my answer not resolve your issue?

http://www.experts-exchange.com/help.jsp#hi403
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.