From: php at kaiundina dot de
Operating system: WinXP home - Apache2
PHP version: 5.0.0
PHP Bug Type: XSLT related
Bug description: XSLTProcessor::transformToXml() doesn't accept DOM-manipulated
XML-tree as XSL
Description:
------------
I tried loading a XML-document an a XSL-document into a XSLTProcessor for
retrieving a transformed XML.
It works fine as long both source documents come from a file.
Then i tried to modify the XSL-tree using DOM-dunctions resulting in the
following algorithm:
1. create XML-Document
2. load XML-document from file
3. create XSL-Document
4. load XSL-document from file
5. modify the XSL-tree // this is the new step
6. create the XSLTProcessor
7. import the XSL-Tree
8. retrieve the resulting XML-string
The resulting XML string is empty ("") then.
I compared the result XSL-Tree after step 5 with the file's content of the
working example - they were identical
I found a really ugly workaround:
inserting the following steps
5.1 render the XSL-tree to a XML-string
5.2 called loadXML() for the existing xsl-document, using the result of
step 5.1
solved the problem - which showed, that my tree was valid for use as XSL.
maybe i'm wrong, but documentation is rare. Hope there's another
solution.
btw: the xsl-extension is declared as experimental - is there a stable
version/equivalent available?
thanks in advance
Kai
(hope this issue wasn't mentioned elsewhere)
Reproduce code:
---------------
I found a code similar to mine, having the same problem. I'll post my own
if necessary.
http://www.zend.org/phorum/read.php?num=6&id=1575&thread=1552
Expected result:
----------------
XSLTProcessor::transformToXml() produces a valid result XML-String
Actual result:
--------------
XSLTProcessor::transformToXml() produces an empty string
--
Edit bug report at http://bugs.php.net/?id=29811&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29811&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29811&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29811&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29811&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29811&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29811&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29811&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29811&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29811&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29811&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29811&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29811&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29811&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29811&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29811&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29811&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29811&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29811&r=float