I have a doc which contains sections( multiple ).
I wants to remove a particular section which contains some text. I am using xpath.
snippet :
$referenceNode= array( 'type' => 'section', 'contains' => 'Bali' ); $queryInfo = $docx->getDocxPathQueryInfo($referenceNode);
But queryinfo gives me :
Array ( [length] => 0 [query] => //w:body/w:p/w:pPr/w:sectPr[1=1 and contains(., 'Mali')]/../.. )
I tried to get a section by it occurrence and its working fine and I am able to remove that section also. But with 'contains' its not working.
I am using removeWordContent method to remove a section.
$docx->removeWordContent($referenceNode);
Also If I am trying to remove a paragraph which contains some particular text it also gets removed successfully.
Can you please assist How can we achieve it?