]> granicus.if.org Git - docbook-dsssl/commitdiff
Add DocBook date -> OPF dc:date mapping and tests
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Fri, 10 Apr 2009 02:04:45 +0000 (02:04 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Fri, 10 Apr 2009 02:04:45 +0000 (02:04 +0000)
xsl/epub/bin/spec/epub_realbook_spec.rb
xsl/epub/bin/spec/files/orm.book.001.xml
xsl/epub/docbook.xsl

index 0804fb6fe129513c85ffb395d9cfc6d48ace257f..837e6e4e434781d0abbfb6d95a6c7918d34aba2b 100755 (executable)
@@ -82,6 +82,11 @@ describe DocBook::Epub do
     @opf_lines.to_s.should =~ /description[^>]+>This is a great title! Many people love it!</
   end
 
+  it "should use the <date> as dc:date for the 'Real Book' test document #{@xml_file}" do
+    @opf_lines.to_s.should =~ /date[^>]+>2008-04-15</
+  end
+
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
     FileUtils.rm_r(@tmpdir2, :force => true)
index 28dabacc29d0b6fc809c41c130e8bdf50a736c43..f3f1f27106935efb4e90ffe5cb3d79bc7e3b63f1 100644 (file)
@@ -113,6 +113,7 @@ Mxxx xx xxx xxxxxxxxxxxx xxxx xx xxxxxxxxxxxxx xxx xxxxxxx xx xxxxxxxxxxx
         <imagedata width="600px" format="JPG" fileref="covers/cvr_lrg.jpg"/>
       </imageobject>
     </mediaobject>
+    <date>2008-04-15</date>
   </bookinfo>
   <dedication>
     <blockquote>
index 680a42adac9d6d068c53607469cafcda647472f6..6db93909ffad800ca30b933827b2c59621991f86 100644 (file)
     </xsl:element>
   </xsl:template>
 
+  <xsl:template match="date" mode="opf.metadata">
+    <xsl:element name="dc:date">
+      <xsl:value-of select="normalize-space(string(.))"/>
+    </xsl:element>
+  </xsl:template>
+
+
   <!-- Space separate the compontents of the abstract (dropping the inline markup, sadly) -->
   <xsl:template match="abstract" mode="opf.metadata">
     <xsl:element name="dc:description">