From: daniel at med dot usyd dot edu dot au
Operating system: Linux
PHP version: 4.3.2
PHP Bug Type: XSLT related
Bug description: xsl:include via scheme handler fails silently
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
--
Edit bug report at http://bugs.php.net/?id=25165&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25165&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25165&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25165&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25165&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25165&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25165&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25165&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25165&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25165&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25165&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25165&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25165&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25165&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25165&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25165&r=gnused