|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25506 <xsl:include> with relative path
Submitted: 2003-09-12 01:48 UTC Modified: 2003-09-19 08:51 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: cryo28 at rbcmail dot ru Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.3 OS: Win2K
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cryo28 at rbcmail dot ru
New email:
PHP Version: OS:


 [2003-09-12 01:48 UTC] cryo28 at rbcmail dot ru
Wrong handling <xsl:include> and <xsl:import> elements with href attribute with relative to main-stylesheet path in domxml_xslt_stylesheet->process. 
Got Error Warning: domxml_xslt_stylesheet(): compilation error: element include in D:\inet\wwwroot\index.php on line 44

Warning: domxml_xslt_stylesheet(): xsl:include : unable to load index/header.xslt in D:\inet\wwwroot\index.php on line 44

Reproduce code:

$xml = some valid xml;
$xslt = domxml_xslt_stylesheet($stylesheetstring);
$result = $xslt->process($xml);


<xsl:include href="main/header.xslt"/>
<xsl:call-template name="header"/><!-- in main header.xslt-->

Expected result:
When When <xsl:include href="/inet/wwwroot/stylesheets/main/header.xslt"/> $xslt->process($xml) works fine. But if
<xsl:include href="main/header.xslt"/> or <xsl:include href="stylesheets/main/header.xslt"/> got warning with no result FALSE.

Directory structure something like 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-19 08:51 UTC]
When loading documents and stylesheets from memory rather than from a file, there is no base directory defined on the document. Either use full paths for the includes or set a base href tag in the stylesheet.

This issue is being addressed in PHP 5 as doing so in the current domxml will break BC.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 23:01:30 2024 UTC