All for a long time know about a problem xslt-transformation in php.
We shall try a trivial way, knowing, that xslt_process () accepts string or resources in it's parameters.
function xslt ($xml, $xsl) {
$xh = @xslt_create();
$args['xml'] = join ('', file ($xml));
$args['xsl'] = join ('', file ($xsl));
// try with a string
$result = @xslt_process ($xh, 'arg:/xml', 'arg:/xsl', NULL, $args);
// try with resource
if (!$result) { $result = @xslt_process ($xh, $xml, $xsl); }
@xslt_free ($xh);
return $result;
}
For example: echo xslt ('./index.xml', './index.xsl');