3

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?

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much for that help, I'm kinda new over here, so I can´t "vote up", but it was really useful, thanks ♥

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.