Commits

Toby Inkster  committed 5eb51c9

release 0.00_01.

  • Participants
  • Parent commits 97beb83

Comments (0)

Files changed (8)

 Bug tracker:  <http://rt.cpan.org/Dist/Display.html?Queue=XML-Atom-Microformats>
 Maintainer:   Toby Inkster <mailto:tobyink@cpan.org>
 
+0.00_01 [2010-04-29]
+ - Take advantage of new XML-Atom-OWL and HTML-Microformats features for
+   better base/document URI handling.
+
 0.00_00 [2010-04-28]
 
 	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Atom-Microformats-0.00_00.tar.gz> ;
 	rdfs:comment    "Initial preview"@en .
 
+my:v_0-00_01
+
+	a               :Version ;
+	dc:issued       "2010-04-29"^^xsd:date ;
+	:revision       "0.00_01"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Atom-Microformats-0.00_01.tar.gz> ;
+	dcs:changeset [
+		a dcs:ChangeSet ;
+		dcs:versus my:v_0-00_00 ;
+		dcs:item
+			[ rdfs:label "Take advantage of new XML-Atom-OWL and HTML-Microformats features for better base/document URI handling."@en ]
+		] .
+
 #############################################################
 
 my:project
 	:tester         toby:i ;
 	:created        "2010-04-14"^^xsd:date ;
 	:license        <http://dev.perl.org/licenses/> ;
-	:release        my:v_0-00_00 .
+	:release        my:v_0-00_00 , my:v_0-00_01 .
 
 #############################################################
 
     <revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.00_00</revision>
     <rdfs:comment xml:lang="en">Initial preview</rdfs:comment>
   </Version>
+  <Version rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Atom-Microformats/v_0-00_01">
+    <dcs:changeset>
+      <dcs:ChangeSet>
+        <dcs:item>
+          <rdf:Description>
+            <rdfs:label xml:lang="en">Take advantage of new XML-Atom-OWL and HTML-Microformats features for better base/document URI handling.</rdfs:label>
+          </rdf:Description>
+        </dcs:item>
+        <dcs:versus rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Atom-Microformats/v_0-00_00"/>
+      </dcs:ChangeSet>
+    </dcs:changeset>
+    <dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-04-29</dc:issued>
+    <file-release rdf:resource="http://backpan.cpan.org/authors/id/T/TO/TOBYINK/XML-Atom-Microformats-0.00_01.tar.gz"/>
+    <revision rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.00_01</revision>
+  </Version>
   <Project rdf:about="http://purl.org/NET/cpan-uri/dist/XML-Atom-Microformats/project">
     <bug-database rdf:resource="http://rt.cpan.org/Dist/Display.html?Queue=XML-Atom-Microformats"/>
     <created rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2010-04-14</created>
     <name>XML-Atom-Microformats</name>
     <programming-language>Perl</programming-language>
     <release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Atom-Microformats/v_0-00_00"/>
+    <release rdf:resource="http://purl.org/NET/cpan-uri/dist/XML-Atom-Microformats/v_0-00_01"/>
     <repository>
       <SVNRepository>
         <browse rdf:resource="http://goddamn.co.uk/viewvc/perlmods/XML-Atom-Microformats/"/>
   homepage: http://search.cpan.org/dist/XML-Atom-Microformats/
   license: http://dev.perl.org/licenses/
   repository: http://goddamn.co.uk/viewvc/perlmods/XML-Atom-Microformats/
-version: 0.00_00
+version: 0.00_01
      my $results = rdf_query($sparql, $feed->model);
 
 VERSION
-    0.00_00
+    0.00_01
 
 DESCRIPTION
     The XML::Atom::Microformats module brings the functionality of

File XML-Atom-Microformats-0.00_01.tar.gz

Binary file added.
 		<link rel="self" href="http://example.com/article/1" />
 		<link rel="profile" href="http://ufs.cc/x/hcard" />
 	</entry>
-	<entry>
+	<entry xml:base="http://bob.com/">
 		<foo property=":fooble">lala</foo>
 		<id>http://example.com/id/2</id>
 		<content type="text/html">

File lib/XML/Atom/Microformats.pm

 
 =head1 VERSION
 
-0.00_00
+0.00_01
 
 =cut
 
-our $VERSION = '0.00_00';
+our $VERSION = '0.00_01';
 our $HAS_RDFA;
 
 BEGIN
 	my $sparql = <<SPARQL;
 PREFIX awol: <http://bblfish.net/work/atom-owl/2006-06-06/#>
 PREFIX iana: <http://www.iana.org/assignments/relation/>
-SELECT ?entry ?entryid ?entrylink ?contenttype ?contentbody ?profile
+SELECT ?entry ?entryid ?entrylink ?contenttype ?contentbody ?contentbase ?contentlang ?profile
 WHERE
 {
 	?entry a awol:Entry ;
 		awol:type ?contenttype ;
 		awol:body ?contentbody .
 	OPTIONAL { ?entry iana:self ?entrylink . }
+	OPTIONAL { ?content awol:base ?contentbase . }
+	OPTIONAL { ?content awol:lang ?contentlang . }
 	OPTIONAL
 	{
 		{ ?feed awol:entry ?entry ; iana:profile ?profile . }
 		$data->{$e}->{'entryid'}     ||= $row->{'entryid'}->literal_value;
 		$data->{$e}->{'contentbody'} ||= $row->{'contentbody'}->literal_value;
 		$data->{$e}->{'contenttype'} ||= $row->{'contenttype'}->literal_value;
-		$data->{$e}->{'entrylink'}   ||= (defined $row->{'entrylink'} ? $row->{'entrylink'}->uri : undef);
+		$data->{$e}->{'contentlang'} ||= $row->{'contentlang'}->literal_value
+			if defined $row->{'contentlang'};
+		$data->{$e}->{'contentbase'} ||= $row->{'contentbase'}->uri
+			if defined $row->{'contentbase'};
+		$data->{$e}->{'entrylink'}   ||= $row->{'entrylink'}->uri
+			if defined $row->{'entrylink'};
 		
 		if (defined $row->{'profile'})
 		{
 			|| $context->{'contenttype'} eq 'application/xhtml+xml';
 		
 		my $dom;
-		my $html = sprintf("<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title></title></head><body><div>%s</div></body></html>",
+		my $html = sprintf("<html xml:lang=\"%s\" lang=\"%s\" xmlns=\"http://www.w3.org/1999/xhtml\"><head><title></title></head><body><div>%s</div></body></html>",
+			$context->{'contentlang'},
+			$context->{'contentlang'},
 			$context->{'contentbody'});
 		
 		my $hmf = HTML::Microformats->new_document(
 			$html,
-			$self->{'base'},
+			($context->{'contentbase'} || $self->{'base'}),
 			type => $context->{'contenttype'});
 		
 		if ($@ || !defined $hmf)