src/ResponseProcessor/SimpleXmlResponseProcessor.php
public function process($xml)
    {
        // Sanitize if necessary:
        if ($this->sanitize) {
            $xml = $this->sanitizeXml($xml);
        }

        // Parse the XML (newer versions of LibXML require a special flag for
        // large documents, and responses may be quite large):
        $flags = LIBXML_VERSION >= 20900 ? LIBXML_PARSEHUGE : 0;
        $oldSetting = libxml_use_internal_errors(true);
        $result = simplexml_load_string($xml, null, $flags);
        $errors = $this->collectXmlErrors();
        libxml_use_internal_errors($oldSetting);
        if (!$result) {
            throw new \Exception('Problem loading XML: ' . $errors);
        }

        // If we got this far, we have a valid response:
        return $result;
    }
public function process($xml)
    {
        // Sanitize if necessary:
        if ($this->sanitize) {
            $xml = $this->sanitizeXml($xml);
        }

        // Parse the XML (newer versions of LibXML require a special flag for
        // large documents, and responses may be quite large):
        $flags = LIBXML_VERSION >= 20900 ? LIBXML_PARSEHUGE : 0;
        $oldSetting = libxml_use_internal_errors(true);
        $result = simplexml_load_string($xml, null, $flags);
        $errors = $this->collectXmlErrors();
        libxml_use_internal_errors($oldSetting);
        if (!$result) {
            throw new \Exception('Problem loading XML: ' . $errors);
        }

        // If we got this far, we have a valid response:
        return $result;
    }
public function process ( $ xml ) { // Sanitize if necessary: if ( $ this -> sanitize ) { $ xml = $ this -> sanitizeXml ( $ xml ) ; } // Parse the XML (newer versions of LibXML require a special flag for // large documents, and responses may be quite large): $ flags = LIBXML_VERSION >= 20900 ? LIBXML_PARSEHUGE : 0 ; $ oldSetting = libxml_use_internal_errors ( true ) ; $ result = simplexml_load_string ( $ xml , null , $ flags ) ; $ errors = $ this -> collectXmlErrors ( ) ; libxml_use_internal_errors ( $ oldSetting ) ; if ( ! $ result ) { throw new \ Exception ( 'Problem loading XML: ' . $ errors ) ; } // If we got this far, we have a valid response: return $ result ; }
Process an OAI-PMH response into a SimpleXML object. Throw an exception if
an error is detected.

@param string $xml Raw XML to process

@return mixed

@throws \Exception
Process an OAI - PMH response into a SimpleXML object . Throw an exception if an error is detected .