Forum


Replies: 2   Views: 3315
Transformdoc generatexhtml
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by SomeOne_01  · 17-08-2012 - 14:38

I am trying to run the example version for generateXHTML. I got Internal Server Error instead.

I am running on PHP 5.2.17 on Windows Server 2008 R2 6.1 using PHPDOCX 2.5 free version

examining the code of transformDOC it seems to be the preg_replace function in the foreachloop in generateXHTML giving this error.

looking closer, when printing the contents of the rel file, it ends with PHP had encountered a stack overflow...

I find it very disturbing that you do not use domdocument to the fullest..... you can better use:

$xmlDOM->loadXML($xml);
$xmlDOM = $xmlDOM->getElementsByTagName("body")->item(0); if you just want to get the body!

this last one will fix the stack overflow problem..but still not getting anything on screen...so question still stands!

Posted by admin  · 11-04-2013 - 12:13

Hello,

You can use DOM functions if you need it, but we prefer to not use it because if XML is not valid it will return a fatal error. You can change anything as needed, phpdocx free is LGPL licensed.

Regards.