|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-24 12:55 UTC] rrichards@php.net
[2004-08-25 21:42 UTC] php at kaiundina dot de
[2004-08-25 23:49 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
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