Subject: | uninitialized $prefix on map_xmlns + xml:lang in twig 3.34 |
Date: | Tue, 16 Feb 2010 08:09:02 +1100 |
To: | bug-XML-Twig [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the debian packaged XML::Twig 3.34 and recent i386 perl 5.10.1, the
program foo.pl below prints
Use of uninitialized value $prefix in string eq at /usr/share/perl5/XML/Twig.pm line 2074.
It seems to be something to do with a combination of xml:lang attribute
and a map_xmlns option (whether empty as in foo.pl or with some actual
mappings). I'm fairly ignorant of xml so I don't really know if this
input is valid, but Twig 3.32 ran it without a warning.
use strict;
use warnings;
use XML::Twig;
my $xml = <<'HERE';
<feed version="0.3" xmlns="http://purl.org/atom/ns\#">
<entry>
<title>Item One</title>
<content xml:lang="de">Hello</content>
</entry>
</feed>
HERE
my $twig = XML::Twig->new (map_xmlns => { });
$twig->parse($xml);