php - XSLTProcessor: multiple xsl files -
i using php xsltprocessor generate html code xml file through xsl file. works.
my problem @ point xsl file gets big work it, makes sense distribute parts external files. neither xsl:import nor xsl:include function works. think reason xsl processor has problems paths, not sure.
inside xsl file use this:
<xsl:import href="2nd_file.xsl"/>
where 2nd_file.xsl in same directory of executing php.
i error:
warning: xsltprocessor::importstylesheet() [xsltprocessor.importstylesheet]: compilation error: file /local/path/to/first/xsl/main.xsl line 7 element import in /local/path/to/php/index.php on line 57 ---- line 57 in php is: $proc->importstylesheet($xsldoc);
/local/path/to/first/xsl/ main.xsl /local/path/to/php/index.php import is. stylesheet expect root url /local/path/to/first/xsl/ . if put sheets import there, should work.
if using xslt2 can call base-uri() show xslt working from.
Comments
Post a Comment