|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-20 04:20 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ I have defined a scheme called 'xslfolder' that read a directory, and creates a stylesheet on the fly that includes all the mentioned folders. I call xsl:include on this stylesheet, and while it doesn't crash, it doesn't passs through all the templates in the folder full of stylesheets. This works under PHP 4.2.2 with Sablot 0.71, but fails under PHP 4.3.1 and 4.3.2 and Sablot 0.98 and 1.0. It doesn't give an actual error; the templates in the subfolder just aren't available. If I write the include statements to a file, and include that, it works perfectly, but it would be much better to use the more elegant scheme method to do it. Reproduce code: --------------- php code: function includeXSLFolder ($folder) { $d = opendir($folder); $str = "<?xml version=\"1.0\"?> \n\n <xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\n"; while (($file = readdir($d)) !== false) { if(strstr($file, ".xsl")!==false && (strstr($file, ".swp")===false) && (strstr($file, ".bak")===false)) $str .="<xsl:include href=\""."../".$folder."/".$file."\"/>\n"; } $str .="</xsl:stylesheet>\n"; return($str); } function mySchemeHandler($processor, $scheme, $rest) { $rest=substr($rest,1); if($scheme == 'xslfolder') return(includeXSLFolder($rest)); } $SchemeHandlerArray["get_all"] = "mySchemeHandler"; xslt_set_scheme_handlers($p,$SchemeHandlerArray); XSL code: <xsl:include href="xslfolder:/doctypetemplates"/> Expected result: ---------------- templates from subfolder should be available Actual result: -------------- templates are not available