Subject: | XML-Twig-3.15: $twig->simplify dies when an element has mixed content |
If XML::Twig parses an XML tree where an element has mixed content (both character content and a child element), calling the "simplify" method causes it to die with this error:
Can't use string ("...") as a HASH ref while "strict refs" in use
at /usr/share/perl5/XML/Twig.pm line 5617.
The string in quotes varies depending on the content of the XML being parsed.
Perl: 5.8.4 (i386-linux-thread-multi)
Linux: 2.6.6-1-686 #1 Wed May 12 14:57:57 EST 2004 i686 GNU/Linux
Some test files that can be used to (hopefully) reproduce the bug...
===== xml-twig-test.pl =====
#! /usr/bin/perl
use Data::Dumper;
use XML::Twig;
my $test_file = "xml-twig-test.xml";
my $twig = new XML::Twig;
$twig->parsefile($test_file);
print Dumper($twig->simplify);
===== xml-twig-test.xml =====
<?xml version="1.0"?>
<xmltwigtest>
<test>
<basic>This is just basic character content.</basic>
</test>
<test>
<mixed>This is character content <i>with</i> something extra.</mixed>
</test>
</xmltwigtest>