]> granicus.if.org Git - docbook-dsssl/commitdiff
Adding patch from Liza Daly to fix problems with XHTML 1.1 DOCTYPES showing up in...
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 4 Nov 2008 23:22:19 +0000 (23:22 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 4 Nov 2008 23:22:19 +0000 (23:22 +0000)
xsl/epub/bin/spec/epub_realbook_spec.rb
xsl/epub/bin/spec/epub_regressions_spec.rb
xsl/epub/docbook.xsl

index 6167a3d9db742ff1845cd3a5880f057f6e59d137..a57149f71e674c146e2eef51d2c6a3d8ccb5a340 100755 (executable)
@@ -71,7 +71,7 @@ describe DocBook::Epub do
   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/
+    @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
index 37a6f1f73b04825fa1525d19ad2f2cd61f3436ac..9f6d55572301489bce391206dabbf927b956add5 100755 (executable)
@@ -85,6 +85,24 @@ describe DocBook::Epub do
     end  
   end  
 
+  it "should not include an XHTML DOCTYPE in the OPF file" do
+    part_file = File.join(@testdocsdir, "subtitle.001.xml") 
+    epub_file = File.join(@tmpdir, File.basename(part_file, ".xml") + ".epub")
+    part_epub = DocBook::Epub.new(part_file, @tmpdir)
+    part_epub.render_to_file(epub_file, $DEBUG)
+
+    FileUtils.copy(epub_file, "./.doctype.epub") if $DEBUG
+
+    xhtml_dtd = "DTD XHTML 1.1"
+
+    itemref_tmpdir = File.join(Dir::tmpdir(), "epubitemref"); Dir.mkdir(itemref_tmpdir) rescue Errno::EEXIST
+    system("unzip -q -o -d #{itemref_tmpdir} #{epub_file}")
+
+    opf_file = File.join(itemref_tmpdir, "OEBPS", "content.opf")
+    xhtml_dtd_in_opf_file = system("grep '#{xhtml_dtd}' #{opf_file}")
+    xhtml_dtd_in_opf_file.should_not be_true
+  end
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
   end  
index e87ca70d7c7b0bf8e1bc0ba7615ecc8fb2118491..6b0b064d868f1f1d92333c6a73d38b1bf835cc70 100644 (file)
       <xsl:with-param name="encoding" select="'utf-8'" />
       <xsl:with-param name="indent" select="'yes'" />
       <xsl:with-param name="quiet" select="$chunk.quietly" />
+      <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank -->
+      <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank -->
       <xsl:with-param name="content">
         <xsl:element name="package">
           <xsl:attribute name="xmlns">http://www.idpf.org/2007/opf</xsl:attribute>
       <xsl:with-param name="encoding" select="'utf-8'" />
       <xsl:with-param name="indent" select="'yes'" />
       <xsl:with-param name="quiet" select="$chunk.quietly" />
+      <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank -->
+      <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank -->
+
       <xsl:with-param name="content">
         <xsl:element name="container">
           <xsl:attribute name="xmlns">urn:oasis:names:tc:opendocument:xmlns:container</xsl:attribute>
       <xsl:with-param name="encoding" select="'utf-8'" />
       <xsl:with-param name="indent" select="'yes'" />
       <xsl:with-param name="quiet" select="$chunk.quietly" />
+      <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank -->
+      <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank -->
       <xsl:with-param name="content">
         <xsl:element name="ncx">
           <xsl:attribute name="version">2005-1</xsl:attribute>
     <xsl:variable name="copyright.date">
       <xsl:call-template name="copyright.years">
         <xsl:with-param name="years" select="year"/>
+        <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
+        <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/>
       </xsl:call-template>
     </xsl:variable>
     <xsl:element name="dc:date">
       <xsl:value-of select="$copyright.date"/>
     </xsl:element>
     <xsl:element name="dc:rights">
-      <xsl:text>Copyright &#x00A9; </xsl:text>
-      <xsl:value-of select="year[1]"/>
-      <xsl:text> </xsl:text>
-      <xsl:value-of select="holder[1]"/>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Copyright'"/>
+      </xsl:call-template>
+      <xsl:call-template name="gentext.space"/>
+      <xsl:text>&#x00A9;</xsl:text>
+      <xsl:call-template name="gentext.space"/>
+      <xsl:value-of select="$copyright.date"/>
+      <xsl:call-template name="gentext.space"/>
+      <xsl:apply-templates select="holder" mode="titlepage.mode"/>
     </xsl:element>
   </xsl:template>