php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

No removeChild() function

Open jdkolassa opened this issue 7 years ago • 4 comments

As far as I can determine, Simple HTML DOM does not have a way to actually remove DOM elements from a document. This can be troublesome, especially if you're using mpdf to make a PDF file and there's an <svg> tag in there; mpdf flips out whenever it sees one.

There may be a good reason removeChild() has not been implemented, but as a suggestion for a future update, could such a function be implemented?

jdkolassa avatar Feb 28 '18 17:02 jdkolassa

I think sunra has only forked the source and added things like namespace, so you have to report this to their sourceforge page

Hodel1 avatar Mar 12 '18 12:03 Hodel1

Ah, good point.

jdkolassa avatar Apr 03 '18 14:04 jdkolassa

FYI only. i hope help you to have more alternative library to work.

sunra idle => paquettg idle => now

now i use the last library. but still monitor all those library, because maybe they have different good point

plonknimbuzz avatar Apr 03 '18 19:04 plonknimbuzz

Here's how I solved it.

$childNode = $dom->find('Your Child Node');
$childNode->setAttribute('outertext','');

Sarasranglt avatar Mar 20 '20 09:03 Sarasranglt