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
<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 © </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>©</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>