Open sunchenweb opened 6 years ago
there is nothing inside your block (except whitespace)?
(between the two block_table
placeholders)
is the xml you give the document before calling replaceBlock
? or after?
when you say it did not work, do you mean that nothing changed in the document?
replaceBlock
method is broken. I use this simple modification:
public function replaceBlock($blockname, $replacement) {
$this->tempDocumentMainPart = preg_replace(
'/(\${' . $blockname . '})(.*?)(\${\/' . $blockname . '})/is',
$replacement,
$this->tempDocumentMainPart
);
}
the funciton replaceBlock in Temproccessor didn't work,debug info below:
the regex is this:
(<\?xml.*)(<w:p.*>\${block_table}<\/w:.*?p>)(.*)(<w:p.*\${\/block_table}<\/w:.*?p>)
and the document.xml like this:how to fix it