sub as_xml {
my ($me) = @_;
- return $me->{feed}->as_xml;
+ my $xml = $me->{feed}->as_xml;
+ # note: http://hublog.hubmed.org/archives/001290.html
+ $xml =~ s| xmlns="http://www.w3.org/2005/Atom"||g;
+ $xml =~ s| xmlns="http://purl.org/atom/ns#"||g;
+ $xml =~ s| xmlns:default="http://www.w3.org/1999/xhtml"||g;
+ $xml =~ s|<content mode="xml">|<content type="xhtml">|g;
+ $xml =~ s|<content mode="escaped">|<content type="html">|g;
+ $xml =~ s|<feed>|<feed xmlns="http://www.w3.org/2005/Atom">|;
+ return $xml;
}
sub print {
my ($me, $fh) = @_;
if (defined $fh) {
- print $fh $me->{feed}->as_xml;
+ print $fh $me->as_xml;
} else {
- print $me->{feed}->as_xml;
+ print $me->as_xml;
}
}