]> granicus.if.org Git - docbook-dsssl/commitdiff
Adding test for dc:rights properly populating from <copyright>
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 8 Oct 2008 03:43:41 +0000 (03:43 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 8 Oct 2008 03:43:41 +0000 (03:43 +0000)
xsl/epub/bin/spec/epub_realbook_spec.rb
xsl/epub/bin/spec/files/orm.book.001.xml
xsl/epub/docbook.xsl

index a59a8116b93062752a6c2d357b85c369747fab05..8f89e4799144f43623121da975f4e563aebcbb50 100755 (executable)
@@ -70,6 +70,10 @@ describe DocBook::Epub do
     @opf_lines.to_s.should =~ /identifier[^>]+>urn:isbn:[0-9]/
   end
 
+  it "should use the <copyright> as dc:rights for the 'Real Book' test document #{@xml_file}" do
+    @opf_lines.to_s.should =~ /rights[^>]+>Copyright © dddd O/
+  end
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
     FileUtils.rm_r(@tmpdir2, :force => true)
index a8c7b703b6924c5a34070c7c3c168ebb98a96350..ae8767bb6be9868dbe5ae86217459cfc73181cbb 100644 (file)
@@ -56,8 +56,7 @@
     </printhistory>
     <copyright>
       <year>dddd</year>
-      <holder>
-O’Rxxxxx Mxxxx    </holder>
+      <holder>O’Rxxxxx Mxxxx</holder>
     </copyright>
     <!-- All rights reserved. -->
     <!-- Published by -->
index 8570c87e4165473c545a692dafa22ed5bcd65fac..ad7ab696bda24a7537dfa676bfaef0d1aa25995f 100644 (file)
               <xsl:value-of select="normalize-space($doc.title)"/>
             </xsl:element>
 
-            <xsl:apply-templates select="/*/*[contains(name(.), 'info')]/author|
-                                         /*/*[contains(name(.), 'info')]/corpauthor|
-                                         /*/*[contains(name(.), 'info')]/authorgroup/author" 
+            <xsl:apply-templates select="/*/*[contains(name(.), 'info')]/*"
                                  mode="opf.metadata"/>        
-            <xsl:apply-templates select="/*/*[contains(name(.), 'info')]/publisher/publishername" mode="opf.metadata"/>
             <xsl:element name="dc:language">
               <xsl:call-template name="l10n.language"/>
             </xsl:element>
       <xsl:value-of select="$copyright.date"/>
     </xsl:element>
     <xsl:element name="dc:rights">
-      <xsl:text>Copyright </xsl:text>
+      <xsl:text>Copyright &#x00A9; </xsl:text>
       <xsl:value-of select="year[1]"/>
-      <xsl:text>, </xsl:text>
+      <xsl:text> </xsl:text>
       <xsl:value-of select="holder[1]"/>
     </xsl:element>
   </xsl:template>