Forum


Replies: 2   Views: 466
Variable replacement in parse mode in text field added in a textbox
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 npoapplications  · 26-05-2023 - 08:55

Hi,

I have a minimal example which produces invalid xml in parse mode when a variable is used in a textfield:

$docx = new CreateDocxFromTemplate($docxPath);
$docx->setTemplateSymbol('##');
$docx->setParseMode(true);

$docx->replaceVariableByText([$key => $placeholderValue]);

Without parseMode the variable isn't detected at all.


This template used work without problems in PHPDocx 6.5, but after upgrading to 14 it produces this error:

DOMDocument::loadXML(): Opening and ending tag mismatch: shape line 1 and t in Entity, line: 1
---ERRFILE---
/var/www/html/library/phpdocx/Classes/Phpdocx/Utilities/XmlUtilities.php
---ERRLINE---
30