#29219 [NEW]: Can't call PHPfunction from XSL
| From: | hans dot huber at combats dot de | Date: | Sat, 17 Jul 2004 00:42:59 +0000 |
| Subject: | #29219 [NEW]: Can't call PHPfunction from XSL | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-62507@lists.php.net to get a copy of this message | ||
From: hans dot huber at combats dot de
Operating system: Linux
PHP version: 5.0.0
PHP Bug Type: XSLT related
Bug description: Can't call PHPfunction from XSL
Description:
------------
When calling a PHP function from XSL I get a failure
message (see below).
Reproduce code:
---------------
<?php
$xml = '<root></root>';
$xsl = <<<EOT
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<foobar>
<xsl:value-of select="php:function('date', 'r')" />
</foobar>
</xsl:template>
</xsl:stylesheet>
EOT;
$xslt = new xsltProcessor();
$xslt->registerPHPFunctions();
$xslt->importStyleSheet(DomDocument::loadXML($xsl));
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"?>
<foobar>r</foobar>
--
Edit bug report at http://bugs.php.net/?id=29219&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29219&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29219&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29219&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29219&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29219&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29219&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29219&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29219&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29219&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29219&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29219&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29219&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29219&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29219&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29219&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29219&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29219&r=float