|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25165 xsl:include via scheme handler fails silently
Submitted: 2003-08-20 02:27 UTC Modified: 2003-08-20 04:20 UTC
From: daniel at med dot usyd dot edu dot au Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
 [2003-08-20 02:27 UTC] daniel at med dot usyd dot edu dot au
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=\"\">\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";
function mySchemeHandler($processor, $scheme, $rest) {
    if($scheme == 'xslfolder')

$SchemeHandlerArray["get_all"] = "mySchemeHandler";

XSL code:
<xsl:include href="xslfolder:/doctypetemplates"/>

Expected result:
templates from subfolder should be available

Actual result:
templates are not available


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue May 18 02:01:23 2021 UTC