I'm trying to import a XSLT stylesheet, but still getting this error...
PHP:
//cadena original
$xsl = new \DOMDocument();
$xsl->load('storage/utils/cadenaoriginal_3_3.xslt');
// Crear el procesador XSLT que nos generará la cadena original con base en las reglas descritas en el XSLT
$proc = new \XSLTProcessor();
// Cargar las reglas de transformación desde el archivo XSLT.
$proc->importStyleSheet($xsl);
XSLT: url: http://www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_3/cadenaoriginal_3_3.xslt
Any idea? :( This is the XSLT used by the goberment, so, it shouldn't have anything wrong inside, but can someone see someting weird or so?
The stylesheet says version="2.0" which probably means it was written for an XSLT 2.0 processor. PHP based on libxslt supports only XSLT 1.0. In theory an XSLT 1.0 processor encountering a higher version declaration should try to switch to forwards compatible processing but I think libxslt does not do that.
So you will need to try to run the XSLT with Saxon 9 or 10, available for Java or .NET or as Saxon-C also with a PHP binding if you need to do it from PHP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With