Subject: | handling new FOAF Autodiscovery syntax |
XML::FOAF 0.02 can't understand new FOAF Autodiscovery syntax.
example: <link rel="meta FOAF.MAKER" type="application/rdf+xml" title="FOAF" href="foaf.rdf"/>
<http://rdfweb.org/topic/Autodiscovery>
This patch handlings FOAF.MAKER rel type in link tag.
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:23:55.000000000 +0900
@@ -82,10 +82,13 @@
my $find_links = sub {
my($tag, $attr) = @_;
$foaf_url = $attr->{href}
- if $tag eq 'link' &&
- $attr->{rel} eq 'meta' &&
- $attr->{type} eq 'application/rdf+xml' &&
- $attr->{title} eq 'FOAF';
+ if ($tag eq 'link' &&
+ $attr->{rel} eq 'meta' &&
+ $attr->{type} eq 'application/rdf+xml' &&
+ $attr->{title} eq 'FOAF')
+ || ($tag eq 'link' &&
+ $attr->{rel} =~ m/FOAF\.MAKER/ &&
+ $attr->{type} eq 'application/rdf+xml')
};
require HTML::Parser;
my $p = HTML::Parser->new(api_version => 3,