in reply to XML::RSS and RSS2 with custom namespaces
So as it says in the docs, you can add namespaces with the add_module method:
Updated: Meh, didn't see the 1.0-only restriction in reading the module code the first time. My bad. Looks like you could just add it in. It's this section:$rss->add_module(prefix=>'my', uri=>'http://purl.org/my/rss/module/' +); $rss->add_item (title=>$title, link=>$link, my=>{ rating=>$rating }) +;
# Ad-hoc modules while ( my($url, $prefix) = each %{$self->{modules}} ) { next if $prefix =~ /^(dc|syn|taxo)$/; while ( my($el, $value) = each %{$self->{channel}->{$prefix}} +) { if ( exists( $rdf_resource_fields{ $url } ) and exists( $rdf_resource_fields{ $url }{ $el }) ) { $output .= qq!<$prefix:$el rdf:resource="! . $self->encode($value) . qq!" />\n!; } else { $output .= "<$prefix:$el>". $self->encode($value) ."< +/$prefix:$el>\n"; } } }
BTW, you do realize that XML::RSS uses XML::Parser, which depends upon expat, which is not pure perl?
The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: XML::RSS and RSS2 with custom namespaces
by BaldPenguin (Friar) on Nov 15, 2006 at 22:35 UTC | |
by brig (Scribe) on Nov 16, 2006 at 00:14 UTC | |
Re^2: XML::RSS and RSS2 with custom namespaces
by BaldPenguin (Friar) on Nov 15, 2006 at 21:55 UTC |
In Section
Seekers of Perl Wisdom