Correct namespace for terms in RSS
Simon Wistow [Thu, 16 Oct 2008 19:02:10 +0000 (19:02 +0000)]
 http://rt.cpan.org/Ticket/Display.html?id=25393
 (Kent Cowgill KCOWGILL)

Changes
lib/XML/Feed/RSS.pm

diff --git a/Changes b/Changes
index 576a50b..90d904e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,6 +2,12 @@
 
 Revision history for XML::Feed
 
+0.22 
+    - Correct namespace for terms in RSS
+      http://rt.cpan.org/Ticket/Display.html?id=25393
+      (Kent Cowgill KCOWGILL)
+    
+
 0.21 2008.10.15
     - Remove the inc directory because it's not needed anymore
 
index 2a04f1d..97937e1 100644 (file)
@@ -15,7 +15,11 @@ sub init_empty {
     eval "use $PREFERRED_PARSER"; die $@ if $@;
     $feed->{rss} = $PREFERRED_PARSER->new(%args);
     $feed->{rss}->add_module(prefix => "content", uri => 'http://purl.org/rss/1.0/modules/content/');
-    $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/rss/1.0/modules/dcterms/');
+    if ($args{'version'} >= 2.0) {
+        $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/dc/terms/');    
+    } else {
+        $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/rss/1.0/modules/dcterms/');
+    }
     $feed;
 }