opf_lns.to_s.should =~ /reference[^>]+type=['"]cover['"]/
end
+ it "should allow pre elements inside blockquotes" do
+ blockquotepre_epub = DocBook::Epub.new(File.join(@filedir, "blockquotepre.xml"), @tmpdir)
+ blockquotepre_epubfile = File.join(@tmpdir, "blockquotepreepub.epub")
+ blockquotepre_epub.render_to_file(blockquotepre_epubfile, $DEBUG)
+ blockquotepre_epubfile.should be_valid_epub
+ end
+
after(:all) do
FileUtils.rm_r(@tmpdir, :force => true)
end
--- /dev/null
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<sect1><title>Blockquote with pre test</title>
+ <blockquote>
+ <para><emphasis>Definition:</emphasis> Let <emphasis>A, B</emphasis>,
+ . . . <emphasis>, Z</emphasis> be subsets of the heading of relvar
+ <emphasis>R</emphasis>. Then <emphasis>R</emphasis> satisfies the
+ <emphasis>join dependency</emphasis> (JD<indexterm id="IDX-CHP-7-0533" significance="normal"><primary>JD</primary></indexterm>)</para>
+ <programlisting format="linespecific" id="I_7_tt242">{ <emphasis>A</emphasis>, <emphasis>B</emphasis>, ..., <emphasis>Z</emphasis> }
+</programlisting>
+ <para>if and only if every relation that's a legal value for
+ <emphasis>R</emphasis> is equal to the join of its projections on
+ <emphasis>A, B</emphasis>, . . . <emphasis>, Z</emphasis>.</para>
+ </blockquote>
+</sect1>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
+ xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias"
xmlns:saxon="http://icl.com/saxon"
exclude-result-prefixes="exsl"
version="1.0">
saxon:character-representation="decimal"
/>
<xsl:preserve-space elements="*"/>
+<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/>
<xsl:template match="/">
<xsl:comment>This file was created automatically by html2xhtml</xsl:comment>
</xsl:copy>
</xsl:template>
+<!-- Bare anchors (<a/>) are not allowed in <blockquote>s -->
+<xsl:template match="xsl:template[@name='anchor']/xsl:if">
+ <xslo:if>
+ <xsl:attribute name="test">
+ <xsl:text>not($node[parent::blockquote])</xsl:text>
+ </xsl:attribute>
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xslo:if>
+</xsl:template>
+
<xsl:template match="xsl:template[@name='body.attributes']">
<xsl:copy>
<xsl:copy-of select="@*"/>
</xsl:copy>
</xsl:template>
+<!-- Bare anchors (<a/>) are not allowed in <blockquote>s -->
+<xsl:template match="xsl:template[@name='anchor']/xsl:if">
+ <xslo:if>
+ <xsl:attribute name="test">
+ <xsl:text>not($node[parent::blockquote])</xsl:text>
+ </xsl:attribute>
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xslo:if>
+</xsl:template>
+
<xsl:template match="xsl:template[@name='body.attributes']">
<xsl:copy>
<xsl:copy-of select="@*"/>