Forum


Replies: 1   Views: 2568
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?