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.
Edited by Sven May ·
19-02-2015 - 08:51 Hello!
I've an HTML content with a number list:
- check enabled (warning appears if length < TORA)
- check disabled
I do not know how I can protect special HTML TAG chars here, sry...so the code above is an ol list with li subtags...and in below too...
My code is:
$docx = new \Phpdocx\Create\CreateDocx();
$wf = new Phpdocx\Elements\WordFragment();
$wf->embedHTML('- check enabled (warning appears if length < TORA)
- check disabled
);
$docx->createDocx('numbering_test');
...and I got the following Warning:
Warning: DOMDocument::loadXML(): Empty string supplied as input .... CreateDocx.inc line 4054
What is wrong?
This is a part of my code. In real case I am using a template...so first I thought that is the problem but when I try to run it
in a clean code like above I got the same error :(Hello,
You need to use this PHP function:
http://php.net/htmlspecialchars
And be sure Tidy is installed and enable.
Regards.
Thanks! I did not think that could be the problem!
Tidy is installed! I checked!
But if I use htmlspecialchars...the suited content will be a text :( So this is not a good solution :(
You meant that?
My code is:
$docx = new \Phpdocx\Create\CreateDocx();
$wf = new Phpdocx\Elements\WordFragment();
$wf->embedHTML(htmlspecialchars('-
check enabled (warning appears if length < TORA)
-
check disabled
'
);
$docx->createDocx('numbering_test'); Hello,
Please send that script to contact@phpdocx.com
Regards.
I checked that I installed successful Tidy.
I use this page: http://polaps.politecnica.edu.gt/Quest/yen_PDF/phpdocx/check.php
...and give warning that I not installed Tidy yet however the pnpinfo say: I use and enabled Tidy...
Edited by Sven May ·
19-02-2015 - 12:16 I've sent! Thx
(In another name: Attila Banhidy)What I see in CreateDocx.php at importSingleNumbering() method that $numberingsXML is null if my HTML content include ol list TAGs.
As you can see in my first post I insert HTML content into a table cell with WordFragment() class and I use CreateDocxFromTemplate() class to create my docx...
Hello,
You don't have Tidy installed or enabled. Please enable it and try again.
Regards.
I did...and tested...it is work! I sent my simple PHP code!
I thonk the problem will be with WordFragment class embedHTML() method.
If I use CreateDocx->embedHTML() method it works fine...but! I have to use WordFregment...if I change I got an XML content :(
I am start to be a little bit confused....
Hello,
Your code has a mistake. You can't use this line:
$wf = new \Phpdocx\Elements\WordFragment();
You need to set the DOCX:
$wf = new \Phpdocx\Elements\WordFragment($docx);
With this minor change the script works perfectly.
Regards.