ApaiIO\ResponseTransformer\XmlToSimpleXmlObject::transform PHP Method

transform() public method

public transform ( $response )
    public function transform($response)
    {
        $simpleXML = simplexml_load_string($response);
        return $simpleXML;
    }

Usage Example

 public function testXmlToSimpleXMLObject()
 {
     $transformer = new XmlToSimpleXmlObject();
     $sampleXML = $this->getSampleXMLResponse();
     $simpleXML = $transformer->transform($sampleXML);
     $this->assertInstanceOf('\\SimpleXMLElement', $simpleXML);
     $this->assertEquals('Wikipedia Städteverzeichnis', $simpleXML->titel);
     $this->assertEquals('Genf', $simpleXML->eintrag[0]->stichwort);
 }
XmlToSimpleXmlObject