ID:               25165
 Updated by:       [EMAIL PROTECTED]
 Reported By:      daniel at med dot usyd dot edu dot au
-Status:           Open
+Status:           Bogus
 Bug Type:         XSLT related
 Operating System: Linux
 PHP Version:      4.3.2
 New Comment:

See: http://www.php.net/manual/en/function.xslt-set-base.php


Previous Comments:
------------------------------------------------------------------------

[2003-08-20 02:27:56] daniel at med dot usyd dot edu dot au

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 this bug report at http://bugs.php.net/?id=25165&edit=1

Reply via email to