protected function decodeResponse($resp)
    {
        //Setup a SimpleXML Document
        try {
            $xml = @new \SimpleXMLElement($resp);
        } catch (\Exception $e) {
            throw new MalformedResponseException(sprintf("Could not decode XML Response: %s", $e->getMessage()));
        }

        //If we get back a OAI-PMH error, throw a OaipmhException
        if (isset($xml->error)) {
            $code = (string) $xml->error['code'];
            $msg  = (string) $xml->error;

            throw new OaipmhException($code, $msg);
        }

        return $xml;
    }
protected function decodeResponse($resp)
    {
        //Setup a SimpleXML Document
        try {
            $xml = @new \SimpleXMLElement($resp);
        } catch (\Exception $e) {
            throw new MalformedResponseException(sprintf("Could not decode XML Response: %s", $e->getMessage()));
        }

        //If we get back a OAI-PMH error, throw a OaipmhException
        if (isset($xml->error)) {
            $code = (string) $xml->error['code'];
            $msg  = (string) $xml->error;

            throw new OaipmhException($code, $msg);
        }

        return $xml;
    }
protected function decodeResponse ( $ resp ) { //Setup a SimpleXML Document try { $ xml = @ new \ SimpleXMLElement ( $ resp ) ; } catch ( \ Exception $ e ) { throw new MalformedResponseException ( sprintf ( "Could not decode XML Response: %s" , $ e -> getMessage ( ) ) ) ; } //If we get back a OAI-PMH error, throw a OaipmhException if ( isset ( $ xml -> error ) ) { $ code = ( string ) $ xml -> error [ 'code' ] ; $ msg = ( string ) $ xml -> error ; throw new OaipmhException ( $ code , $ msg ) ; } return $ xml ; }
Decode the response into XML

@param  string            $resp The response body from a HTTP request
@return \SimpleXMLElement An XML document
Decode the response into XML