I have PHP code which removes all nodes that have at least one attribute. Here is my code:
These
This will remove all tags that have class and style attributes, so it's not a bullet proof:
These line shall stay
Remove this one
But keep this
and this
Note this line:
$lines_to_be_removed = $xpath->query("//*[count(@class)>0] or count(@style)>0]");