Skip Menu |

This queue is for tickets about the XML-RSS CPAN distribution.

Report information
The Basics
Id: 4873
Status: resolved
Priority: 0/
Queue: XML-RSS

People
Owner: Nobody in particular
Requestors: miyagawa [...] bulknews.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: $AUTO_ADD doesn't work as expected
XML::RSS documentation says if you set $AUTO_ADD to 1, XML::RSS will automatically add_module() instead of you. It seems true, as it calls add_module() in parse() if $AUTO_ADD == 1, but it'd work as expected, when you use parse() method. Think of content:encoded for example, $XML::RSS::AUTO_ADD = 1; my $rss = XML::RSS->new(); my $xml = get($url); $rss->parse($xml); print $rss->items->[0]->{content}->{encoded}; It doesn't return anything. As _auto_add_modules() is called *after* SUPER::parse(), reallocating namespaces to prefix in $rss's hash doesn't work. Thus, it'd work: $XML::RSS::AUTO_ADD = 1; $rss->parse($xml); # add_module()ed $rss->parse($xml); # now correctly assigned to hash keys of prefix. It's not a bug, but it can be very confusing to users. Thanks,
You're right that is confusing. In fact I was confused about what it was supposed to do. I've never liked that feature, but I updated the documentation to make it clearer. [guest - Thu Jan 8 10:09:04 2004]: Show quoted text
> XML::RSS documentation says if you set $AUTO_ADD to 1, XML::RSS will > automatically add_module() instead of you. It seems true, as it > calls add_module() in parse() if $AUTO_ADD == 1, but it'd work as > expected, when you use parse() method. > > Think of content:encoded for example, > > $XML::RSS::AUTO_ADD = 1; > my $rss = XML::RSS->new(); > my $xml = get($url); > $rss->parse($xml); > > print $rss->items->[0]->{content}->{encoded}; > > It doesn't return anything. As _auto_add_modules() is called *after* > SUPER::parse(), reallocating namespaces to prefix in $rss's hash > doesn't work. Thus, it'd work: > > $XML::RSS::AUTO_ADD = 1; > $rss->parse($xml); # add_module()ed > $rss->parse($xml); # now correctly assigned to hash keys of prefix. > > It's not a bug, but it can be very confusing to users. > > Thanks,