protected function getArrayForSpecialCase($xml)
    {
        $regEx            = '#\s*(&lt;\?xml.*interface&gt;)\s*#is';
        $regExReplace     = '#\s*>\s*(&lt;\?xml.*interface&gt;)\s*<[^>]+>\s*#is';
        $regExReplaceWith = '/>';

        // what can happen is that the valid XML element suddenly has,
        // as its element content, a full version of url-encoded XML.
        if ( ! preg_match($regEx, $xml)) {
            return [0 => $xml];
        }
        $xml = preg_replace($regExReplace, $regExReplaceWith, $xml);

        return $this->parse($xml);
    }
protected function getArrayForSpecialCase($xml)
    {
        $regEx            = '#\s*(&lt;\?xml.*interface&gt;)\s*#is';
        $regExReplace     = '#\s*>\s*(&lt;\?xml.*interface&gt;)\s*<[^>]+>\s*#is';
        $regExReplaceWith = '/>';

        // what can happen is that the valid XML element suddenly has,
        // as its element content, a full version of url-encoded XML.
        if ( ! preg_match($regEx, $xml)) {
            return [0 => $xml];
        }
        $xml = preg_replace($regExReplace, $regExReplaceWith, $xml);

        return $this->parse($xml);
    }
protected function getArrayForSpecialCase ( $ xml ) { $ regEx = '#\s*(&lt;\?xml.*interface&gt;)\s*#is' ; $ regExReplace = '#\s*>\s*(&lt;\?xml.*interface&gt;)\s*<[^>]+>\s*#is' ; $ regExReplaceWith = '/>' ; // what can happen is that the valid XML element suddenly has, // as its element content, a full version of url-encoded XML. if ( ! preg_match ( $ regEx , $ xml ) ) { return [ 0 => $ xml ] ; } $ xml = preg_replace ( $ regExReplace , $ regExReplaceWith , $ xml ) ; return $ this -> parse ( $ xml ) ; }
In special cases where XML is malformed, attempt to salvage the
last element anyway.

Not used at the moment..

@param string $xml
@return array
@throws CouldNotInterpretXmlResponseException
In special cases where XML is malformed attempt to salvage the last element anyway .