Subject: | handling the W3C Note "XHTML Media Types" |
XML::FOAF 0.02 can't understand XHTML Media Types.
<http://www.w3.org/TR/xhtml-media-types/>
This patch handling some media types - "application/xhtml+xml", "application/xml" and "text/xml".
diff -uNr XML-FOAF-0.02.orig/lib/XML/FOAF.pm XML-FOAF-0.02/lib/XML/FOAF.pm
--- XML-FOAF-0.02.orig/lib/XML/FOAF.pm 2003-06-25 07:35:40.000000000 +0900
+++ XML-FOAF-0.02/lib/XML/FOAF.pm 2004-12-03 23:21:01.000000000 +0900
@@ -77,7 +77,8 @@
my $ua = $foaf->{ua};
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
- if ($res->content_type eq 'text/html') {
+ if ($res->content_type eq ('text/html'||'application/xhtml+xml'||
+ 'application/xml'||'text/xml')) {
my $foaf_url;
my $find_links = sub {
my($tag, $attr) = @_;