#29811 [Opn->Fbk]: XSLTProcessor::transformToXml() doesn't accept DOM-manipulated XML-tree as XSL
| From: | rrichards@php.net | Date: | Tue, 24 Aug 2004 10:55:54 +0000 |
| Subject: | #29811 [Opn->Fbk]: XSLTProcessor::transformToXml() doesn't accept DOM-manipulated XML-tree as XSL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65160@lists.php.net to get a copy of this message | ||
ID: 29811
Updated by: rrichards@php.net
Reported By: php at kaiundina dot de
-Status: Open
+Status: Feedback
Bug Type: XSLT related
Operating System: WinXP home - Apache2
PHP Version: 5.0.0
New Comment:
Check that you handle the namespaces correctly when modifying the doc
and that this is not just a coding error. If this is not the case,
please post link to code.
See http://www.ctindustries.net/dom/domxsl.txt for
an example of
building an xsl stylesheet manually using dom.
Previous Comments:
------------------------------------------------------------------------
[2004-08-24 11:25:36] php at kaiundina dot de
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 this bug report at http://bugs.php.net/?id=29811&edit=1