From: clicknmix at gmail dot com
Operating system: Linux
PHP version: 5.0.4
PHP Bug Type: XSLT related
Bug description: php:function no longer handles returned dom objects
Description:
------------
When using a function with XSLTProcessor->registerPHPFunctions() to return
a dom object, it no longer handles it as XML, and produces an error.
Reproduce code:
---------------
Function is:
function myxml ($Value="default")
{
$dom = new domdocument();
$dom->loadXML("<root>this is from an external DomDocument -
$Value</root>");
return $dom;
}
and XSLT call is:
<xsl:value-of select="php:function('myxml','Hello World')/root" />
Full scripts at:
http://home.protocol80.co.uk/php5/collection.phps
http://home.protocol80.co.uk/php5/collection.xml
http://home.protocol80.co.uk/php5/collection.xml
Expected result:
----------------
In previous versions you could access the tree of the returned XML and
print the output. (As if you were including a flat XML file)
Actual result:
--------------
Warning: XSLTProcessor::transformToXml() [function.transformToXml]: A PHP
Object can not be converted to a XPath-string in
/controlpanel/hosts/design/htdocs/test/collection.php on line 22
Warning: Invalid type in
/controlpanel/hosts/design/htdocs/test/collection.php on line 22
Warning: runtime error: file
/controlpanel/hosts/design/htdocs/test/collection.xsl element value-of in
/controlpanel/hosts/design/htdocs/test/collection.php on line 22
Warning: xsltValueOf: text copy failed in
/controlpanel/hosts/design/htdocs/test/collection.php on line 22
--
Edit bug report at http://bugs.php.net/?id=33299&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33299&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33299&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33299&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33299&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33299&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33299&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33299&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33299&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33299&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33299&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33299&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33299&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33299&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33299&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33299&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33299&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33299&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33299&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33299&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33299&r=mysqlcfg