]> granicus.if.org Git - docbook-dsssl/commitdiff
Better dc:publisher (ALWAYS WRITE TESTS FIRST!)
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 8 Oct 2008 18:09:13 +0000 (18:09 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 8 Oct 2008 18:09:13 +0000 (18:09 +0000)
xsl/epub/bin/spec/epub_realbook_spec.rb
xsl/epub/bin/spec/files/orm.book.001.xml
xsl/epub/docbook.xsl

index 8f89e4799144f43623121da975f4e563aebcbb50..6167a3d9db742ff1845cd3a5880f057f6e59d137 100755 (executable)
@@ -74,6 +74,10 @@ describe DocBook::Epub do
     @opf_lines.to_s.should =~ /rights[^>]+>Copyright © dddd O/
   end
 
+  it "should use the <publishername> as dc:publisher for the 'Real Book' test document #{@xml_file}" do
+    @opf_lines.to_s.should =~ /publisher[^>]+>O'Rxxxxx Mxxxx, Ixx.</
+  end
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
     FileUtils.rm_r(@tmpdir2, :force => true)
index ae8767bb6be9868dbe5ae86217459cfc73181cbb..c63ab774293a47dc635bc2b9a83f39941fab6643 100644 (file)
@@ -61,8 +61,7 @@
     <!-- All rights reserved. -->
     <!-- Published by -->
     <publisher>
-      <publishername>
-O’Rxxxxx Mxxxx, Ixx.    </publishername>
+      <publishername>O'Rxxxxx Mxxxx, Ixx.</publishername>
       <address format="linespecific">
         <street>dddd Gxxxxxxxxxx Hxxxxxx Nxxxx</street>
         <city>Sxxxxxxxxx</city>
index 8ecd18374559320ec4c8a4269d82a63808b59883..e87ca70d7c7b0bf8e1bc0ba7615ecc8fb2118491 100644 (file)
     </xsl:element>
   </xsl:template>
 
-  <xsl:template match="publisher/publishername|publishername" mode="opf.metadata">
+  <xsl:template match="publisher" mode="opf.metadata">
+    <xsl:apply-templates select="publishername" mode="opf.metadata"/>
+  </xsl:template>
+  
+  <xsl:template match="publishername" mode="opf.metadata">
     <xsl:element name="dc:publisher">
       <xsl:value-of select="normalize-space(string(.))"/>
     </xsl:element>