Tuesday, 15 March 2011

php - XSLTProcessor: multiple xsl files -


I am using php XSLTProcessor to generate my HTML code from an XML file via XSL file. Does it work.

My problem is at some point, the XSL file becomes too big to work with it easily, so it makes sense to distribute some parts to external files. But neither the XSL: Import nor the XSL: Function functions are included. I think that probably the reason is that the XSL processor has problems with the path, but I'm not sure.

It is used within my XSL file:

    

Where 2nd_file.xsl is in the same directory of execution php

I get this error:

Warning: XSLTProcessor :: importStylesheet () [xsltprocessor.importstylesheet]: compilation error: file / local / path / per / first / xsl /main.xsl line 7 element / / / / row / on / php / index Import into php line 57 ---- Line 57 has php: $ proc-> Import stylesheet ($ xslDoc);

/ local / path / to / first / xsl / where main.xsl but / Local / path is /to/php/index.php where you will expect your stylesheet to be root url / local / path / to / before / xsl / if you keep the sheets for import there, So this should work.

If you are using XSLT2, you can show Base-Yuri () to call that you are working with XSLT.


No comments:

Post a Comment