Hi!
I need to replace <text:line-break/> tag with empty space
This is my code but something is wrong, can you help me?
<text:index-body>
<text:p text:style-name=”P9″>AAAA
<text:tab/>5</text:p>
<text:p text:style-name=”P9″>
<text:s/>BBB
<text:line-break/>bb1
<text:tab/>6</text:p>
<text:p text:style-name=”P9″>
<text:s/>CCC
<text:line-break/>cc1
<text:tab/>6</text:p>
<text:p text:style-name=”P9″>
<text:index-body/>
$xml=new DOMDocument();
$xml->load($_tmp.”/content.xml”);
$xp= new DOMXPath($xml);
$xquery = “/office:document-content/descendant-or-self::text:index-body”;
$xpic_art= $xp->query($xquery);
for ($k=0; $k<$xpic_art->length; $k++) {
$s=$xpic_art->item($k);
$xpic5=$xp->query(“.//text:line-break”, $s);
if($xpic5->length >0){
$p=$xpic5->item(0);
$p->parentNode->replaceChild(”, $p);
}
}
$content=$xml->saveXML();