Forum


Replies: 1   Views: 2535
Domdocument::loadxml() error when not using right template symbol
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 arnaudbouchard  · 02-05-2018 - 04:44

Hi there,

I am using templates where I decided that '~' would be more appropriate as a symbol, so I set it when creating the doc via:

$docx->setTemplateSymbol('~');

Everything works fine, unless I try to use a template where another symbol was used (say, a legacy template where the symbol was '#'). In this template, there is a BLOCK looking like:

#BLOCK_testblock#
This is just a dummy text.
#BLOCK_testblock#

 

When trying to use $docx->clearBlocks(); it causes the following error:

(1/1) ErrorException

DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 2

in CreateDocxFromTemplate.inc (line 106)

Why is that? Shouldn't the block just not be detected and that's it?

Posted by admin  · 02-05-2018 - 10:59

Hello,

It's a very strange issue, maybe you need to escape some character?. We have done some tests and everything is working as expected.

Please send to contact[at]phpdocx.com the most simple sample that illustrates your issue (the DOCX template and the script). As we need to run it please do not do external connections such as databases or web services.

Regards.