Closed luisorozcomlv closed 6 years ago
I tried without any setValue, only reading and saving the document, but still got the same error.
@luisorozcomlv can you share the document (or any other document) that makes this fail?
@luisorozcomlv I don't know if that's the cause of the issue but if you check the source (rename to dictamTpl.zip and unzip) you will see that the ${acciondenominada}, ${fechajuntaaclaratotia}, ... are split over multiple xml nodes. This causes the replacement to fail. Fix this in the source document I'm pretty sure it will be OK.
It works!. Thank you. BTW, i also change the isolated $ chars to it html entity.
sorry, this is my first post on githb...
Expected Behavior
Create a new document from another docx file using template processor
Current Behavior
working fine, no error reportes durning script execution
Failure Information
When i try to open the result docx file i got this error:
the name in the end tag of the element must match the element type in the start tag:
Location: Part: /word/document.xml Line 2: Column:
How to Reproduce
$template = new \PhpOffice\PhpWord\TemplateProcessor("dictamTpl.docx");
foreach($onlyOneRow as $n => $c) {
$c = xmlEntities($c); $template->setValue($n, $c); $template->setValue(strtoupper($n), $c); }
$template->saveAs('result.docx');
Context