|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29219 Can't call PHPfunction from XSL
Submitted: 2004-07-17 02:42 UTC Modified: 2004-07-17 11:22 UTC
From: hans dot huber at combats dot de Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.0.0 OS: Linux
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: hans dot huber at combats dot de
New email:
PHP Version: OS:


 [2004-07-17 02:42 UTC] hans dot huber at combats dot de
When calling a PHP function from XSL I get a failure 
message (see below). 

Reproduce code:
$xml = '<root></root>';

$xsl = <<<EOT
<xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:template match="/">
    <xsl:value-of select="php:function('date', 'r')" />

$xslt = new xsltProcessor();

print $xslt->transformToXML(DomDocument::loadXML($xml));

Expected result:
<foobar>Current date</foobar> 

Actual result:
Warning: xmlXPathCompOpEval: function function bound to 
undefined prefix php 
in /home/hans/tests/php5/xsl/convert.php on line 18 
Warning: xmlXPathCompiledEval: 1 object left on the stack 
in /home/hans/tests/php5/xsl/convert.php on line 18 
<?xml version="1.0"?> 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-17 11:22 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

You didn't define the PHP namespace...

<xsl:stylesheet xmlns:xsl="" xmlns:php="" version='1.0'>

is needed.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu May 06 02:01:23 2021 UTC