php.net |  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
Votes:3
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cryo28 at rbcmail dot ru
New email:
PHP Version: OS:

 

 [2003-09-12 01:48 UTC] cryo28 at rbcmail dot ru
Description:
------------
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
error!



Reproduce code:
---------------
php:

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

xslt:

<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 
d:\inet\wwwroot\index.php
d:\inet\wwwroot\stylesheets\main.xslt
d:\inet\wwwroot\stylesheets\main\header.xslt





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-19 08:51 UTC] rrichards@php.net
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: Thu Mar 28 19:01:29 2024 UTC