src/Web/Communicator.php
protected function convertXmlToArray($xml)
    {
        // Convert the response to an array via a 3-way conversion:
        // - create a simplexml object
        // - convert that to json
        // - convert json to array
        libxml_use_internal_errors(true);
        if (!($result = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA))) {
            $this->raiseLibxmlError(libxml_get_errors());
        }

        if (!($result = json_encode($result))) {
            $this->raiseJsonError();
        }
        if (($result = json_decode($result, true)) === null) {
            $this->raiseJsonError();
        }

        return $result;
    }
protected function convertXmlToArray($xml)
    {
        // Convert the response to an array via a 3-way conversion:
        // - create a simplexml object
        // - convert that to json
        // - convert json to array
        libxml_use_internal_errors(true);
        if (!($result = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA))) {
            $this->raiseLibxmlError(libxml_get_errors());
        }

        if (!($result = json_encode($result))) {
            $this->raiseJsonError();
        }
        if (($result = json_decode($result, true)) === null) {
            $this->raiseJsonError();
        }

        return $result;
    }
protected function convertXmlToArray ( $ xml ) { // Convert the response to an array via a 3-way conversion: // - create a simplexml object // - convert that to json // - convert json to array libxml_use_internal_errors ( true ) ; if ( ! ( $ result = simplexml_load_string ( $ xml , 'SimpleXMLElement' , LIBXML_NOCDATA ) ) ) { $ this -> raiseLibxmlError ( libxml_get_errors ( ) ) ; } if ( ! ( $ result = json_encode ( $ result ) ) ) { $ this -> raiseJsonError ( ) ; } if ( ( $ result = json_decode ( $ result , true ) ) === null ) { $ this -> raiseJsonError ( ) ; } return $ result ; }
Converts an XML string to an array.

@param string $xml
A string containing XML.

@return array
An array representation of the XML string.

@throws \RuntimeException
Converts an XML string to an array .