I'm trying to run an xslt script over a xml response. But I'm having problems getting PHP/XSLT to understand the response. My PHP looks like this, the $data variable contains the XML
$movies = new SimpleXMLElement($data);
// Load the XML source
$xml = new DOMDocument;
$xml->load($movies);
$xsl = new DOMDocument;
$xsl->load('/var/www/html/app/views/xslt/rdf.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$res = $proc->transformToXML($xml);
I'm getting
production.ERROR: exception 'ErrorException' with message 'DOMDocument::load(): I/O warning : failed to load external entity "/var/www/public/
"'
as my error. I've tried using simplexml_load_file and simplexml_load_string but have similar results.
load
command says that it can so some schema checking with respect to external entities. Actually this should be deactivated but maybe you have some other global settings. Could you check if your XSL has a header reference to a schema file starting with/var/www/public/
?