opf_lns.to_s.should_not =~ /opf:manifest/
end
+ it "should use the @lang of the document being converted for the OPF metadata" do
+ opf_lns = opf_lines('de.xml', @filedir)
+ opf_lns.to_s.should =~ /language[^>]*>de</
+ end
+
+
after(:all) do
FileUtils.rm_r(@tmpdir, :force => true)
end
--- /dev/null
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<article lang="de">
+ <articleinfo>
+ <title>Test file</title>
+
+ <date>2009-04-12</date>
+
+ <author>
+ <firstname>Michael</firstname>
+ <surname>Wiedmann</surname>
+ </author>
+
+ <publisher><publishername>Person</publishername></publisher>
+ <biblioid class="other">unique-doc-id</biblioid>
+
+ <copyright>
+ <year>2009</year>
+ <holder>Michael Wiedmann</holder>
+ </copyright>
+
+ <abstract id="abstract">
+ <para>some abstract</para>
+ </abstract>
+ </articleinfo>
+
+ <section>
+ <title>Title</title>
+ <para>foo foo</para>
+ </section>
+
+</article>
<xsl:apply-templates select="/*/*[contains(name(.), 'info')]/*"
mode="opf.metadata"/>
<xsl:element name="dc:language">
- <xsl:call-template name="l10n.language"/>
+ <xsl:call-template name="l10n.language">
+ <xsl:with-param name="target" select="/*"/>
+ </xsl:call-template>
</xsl:element>
<xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]">