php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46729 xslt_base_dir parameter doesn't work
Submitted: 2008-12-02 09:29 UTC Modified: 2008-12-16 14:38 UTC
From: gpl at ircf dot fr Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.2.6 OS: Linux Ubuntu 8.10
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gpl at ircf dot fr
New email:
PHP Version: OS:

 

 [2008-12-02 09:29 UTC] gpl at ircf dot fr
Description:
------------
Base path cannot be changed by setting the parameter xslt_base_dir in the xslt processor. This bug was also reported here : http://bugs.php.net/bug.php?id=43454&edit=3

Reproduce code:
---------------
<?php
// First, load a XSL stylesheet
$xslDom = DomDocument::loadXML('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:include href="foo"/></xsl:stylesheet>');

// Then initialize the XSLTProcessor
$xsltProcessor = new xsltprocessor();

// Set the xslt_base_dir
$xsltProcessor->setParameter('','xslt_base_dir','base');


// Import the stylesheet in the processor
$xsltProcessor->importStylesheet($xslDom);
?>

Expected result:
----------------
This program should raise the following warning : Failed to load external entity ".../base/foo"

Actual result:
--------------
The program raises the warning : Failed to load external entity ".../foo"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-16 14:38 UTC] rrichards@php.net
That syntax is from the old sablotron extension.
You can set the base directory from a document loaded via memory using:
$xslDom->documentURI = dirname(__FILE__) . '/base/';


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC