Index: RSS.pm
===================================================================
RCS file: /var/lib/cvs/cpan/XML-RSS-Feed/lib/XML/RSS.pm,v
retrieving revision 1.1
diff -u -r1.1 RSS.pm
--- RSS.pm 15 Jan 2004 14:06:30 -0000 1.1
+++ RSS.pm 15 Jan 2004 14:58:00 -0000
@@ -1,4 +1,4 @@
-# $Id: RSS.pm,v 1.1 2004/01/15 14:06:30 jbisbee Exp $
+# $Id: RSS.pm,v 1.22 2003/02/20 19:19:07 kellan Exp $
package XML::RSS;
use strict;
@@ -1429,6 +1429,7 @@
my %attribs = @_;
# beginning of RSS 0.91
+ my $ns = $self->namespace( $el ) || "";
if ($el eq 'rss') {
if (exists($attribs{version})) {
$self->{_internal}->{version} = $attribs{version};
@@ -1474,9 +1475,6 @@
# beginning of item element
} elsif ($el eq 'item') {
- # deal with trouble makers who use mod_content :)
- my $ns = $self->namespace( $el );
-
if (
(!$ns && !$self->{rss_namespace}) ||
($ns eq $self->{rss_namespace})
@@ -1503,12 +1501,10 @@
$self->{'modules'}->{'
http://purl.org/rss/1.0/modules/taxonomy/'} = 'taxo';
}
# beginning of a channel element that stores its info in rdf:resource
- elsif ( exists( $rdf_resource_fields{ $self->namespace($el) } ) and
- exists( $rdf_resource_fields{ $self->namespace($el) }{ $el } ) and
+ elsif ( exists( $rdf_resource_fields{$ns} ) and
+ exists( $rdf_resource_fields{ $ns }{ $el } ) and
$self->current_element eq 'channel' )
{
- my $ns = $self->namespace( $el );
-
if ( $ns eq $self->{rss_namespace} ) {
$self->{channel}->{$el} = $attribs{resource};
}
@@ -1523,12 +1519,10 @@
}
}
# beginning of an item element that stores its info in rdf:resource
- elsif ( exists( $rdf_resource_fields{ $self->namespace($el) } ) and
- exists( $rdf_resource_fields{ $self->namespace($el) }{ $el } ) and
+ elsif ( exists( $rdf_resource_fields{ $ns } ) and
+ exists( $rdf_resource_fields{ $ns }{ $el } ) and
$self->current_element eq 'item' )
{
- my $ns = $self->namespace( $el );
-
if ( $ns eq $self->{rss_namespace} ) {
$self->{'items'}->[$self->{num_items}-1]->{ $el } = $attribs{resource};
} else {