I have a XML file that has HTML in it. Within the HTML tags there are attributes I'd like to remove, yet I need to keep all of the tags. An example would be:
<description><![CDATA[<div><span style='font-size: 40px'>Testing123</span></div>]]></description>
I'd like to remove the 'style' attribute so that the output is:
<description><![CDATA[<div><span>Testing123</span></div>]]></description>
I was sort of able to get this working using preg_replace, but then the formatting was way off when I went to save the file. In other words, I want to preserve the formatting of the XML file after the parsing/stripping of my file.
EDIT: The initial sample data I provided doesn't include CDATA that is within my XML file. I modified that.