How can Perl's XML::Simple ignore HTML embedded in XML?
- by Miriam Raphael Roberts
I have an XML file that I am pulling from the web and parsing. One of the items in the XML is a 'content' value that has HTML. I am using XML::Simple::XMLin to parse the file like so:
$xml= eval { $data->XMLin($xmldata, forcearray => 1, suppressempty=> +'') };
When I use Data::Dumper to dump the hash, I discovered that SimpleXML is parsing the HTML into the hash tree:
'content' = {
'div' = [
{
'xmlns' = 'http://www.w3.org/1999/xhtml',
'p' = [
{
'a' = [
{
'href' = 'http://miamiherald.typepad.com/.a/6a00d83451b26169e20133ec6f4491970b-pi',
'style' = 'FLOAT: left',
'img' = [
etc.....
This is not what I want. I want to just grab content inside of this entry. How do I do this?