Forum


Replies: 7   Views: 5250
[docx v2.6] replacetemplatevariablebyhtml issue
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 js  · 17-09-2012 - 08:37

Hi,

I am using the latest Version of PHPDOCX (v2.6) with a pro License. I would like to add some paragraphes using the replaceTemplateVariableByHTML function descibed here: 8http://www.phpdocx.com/documentation/api-documentation/replacevariablebyhtml-inserts-html-in-a-template. Following the example I have added the exact line like that:
[code]
$docx->replaceTemplateVariableByHTML('OBJECTIVES', 'inline', '<p style="font-family: verdana; font-size: 11px">C/ Matías Turrión 24, Madrid 28043 <b>Spain</b></p>', array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false));
[/code]
which in may case result in the following error messages:
[quote]
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1457

Warning: DOMXPath::query() [domxpath.query]: Undefined namespace prefix in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1462

Warning: DOMXPath::query() [domxpath.query]: Invalid expression in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1462

Warning: Invalid argument supplied for foreach() in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1464

Warning: DOMDocument::loadXML() [domdocument.loadxml]: Start tag expected, '<' not found in Entity, line: 2 in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1457

Warning: DOMXPath::query() [domxpath.query]: Undefined namespace prefix in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1462

Warning: DOMXPath::query() [domxpath.query]: Invalid expression in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1462

Warning: Invalid argument supplied for foreach() in /var/www/view_extensions/php_docx/v2.6_pro/classes/CreateTemplate.inc on line 1464
[/quote]

The error messages go away as soon as I remove the above line. Changing the html code to a simple "<p>Hello World</p>" doesn't help...

Any help would be appreciated.