PHP SimpleXML problem

Posted on 2008-11-13
Last Modified: 2012-05-05
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?

<?xml version="1.0" encoding="UTF-8"?> 

<WIRECARD_BXML xmlns:xsi="" xsi:noNamespaceSchemaLocation="wirecard.xsd"> 












        <Message>Expiration date invalid.</Message> 

        <Advice>Expiration date must not be exceeded.</Advice> 






//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

Question by:arthrex
    LVL 39

    Accepted Solution

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

    Open in new window

    LVL 39

    Expert Comment

    by:Roger Baklund
    Did my answer not resolve your issue?

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now