]> granicus.if.org Git - docbook-dsssl/commitdiff
Add more careful handling of refentries to ensure that they always appear in the...
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Thu, 20 Aug 2009 05:02:22 +0000 (05:02 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Thu, 20 Aug 2009 05:02:22 +0000 (05:02 +0000)
This was only a problem when refentries were pushed deep into the hierarchy (like inside
a sect2), but presented navigational problems for many reading systems (despite the
correct NCX references). This may *not* be the best solution, but attacking a better
chunking strategy for refentries was too big a nut to crack at this time.

xsl/epub/bin/spec/epub_regressions_spec.rb
xsl/epub/bin/spec/files/orm.book.001.xml
xsl/epub/docbook.xsl

index 0d0172f95066caa7c19d50d85f8c23bbb604e1f6..af7c7f19bf53c693e4af233ff12f0f4444b05a87 100755 (executable)
@@ -176,6 +176,12 @@ describe DocBook::Epub do
     typed_index_epubfile.should be_valid_epub  
   end
 
+  it "should include chunked refentries in the spine even when they're deeply nested" do
+    opf_lns = opf_lines('orm.book.001.xml', @filedir)
+    re01_id = opf_lns.to_s.sub(/.+<item id="([^"]+)" href="re01.html".+/m, '\1')
+    opf_lns.to_s.should =~ /<itemref idref="#{re01_id}"/
+  end
+
   after(:all) do
     FileUtils.rm_r(@tmpdir, :force => true)
   end  
index 75e9f230e90d83ac3c560f6bd3f36dee8bbd7011..a622d2a4144888259096e6feb110011cfbc3e28d 100644 (file)
@@ -988,6 +988,8 @@ Txxxx xxx x xxx xxxxxx xxxx xxxxx xxx xxxxxxx xxxx xxx xxxx xxxxxx. Txxx xxx xxx
 Txxxx xxx x xxxxxxx xxxxxx xxxx xxxxx xxx xxxxxxx xxxxxxx. Sxxxxx xxxx xxxxx xxx xxxx-xxxxxxxxx. Sx xxxxxxxxx xxx xxxxxxxxx xxxxxxx xxxxxx xxxxxxxxx xxxx xxxxxx xx xxxxxxxxx. Fxx x xxx xx xxx xxxxxx xxxx xxxxx, x xxxxxxx xxxxxx xxxxx xxx xx xxxxxxxxx. Ix x xxxxxx xx xxxxxxx xx x xxxxxx xxxx xxxxxxx xxx xxxxx xxx xxx xxx xxxxxx, xxx xxxxxx xxxx xx xxxxx-xxxxxxxxx xxxx xxxxxx. Bxxxxx xxxxxxx xxx xxxx-xxxxxxxxx.
 </para>
       <para>Bxxxx xx x xxxx xx xxxxxx xxxx xxxxx, xxxx’xx xxx xxxxxxxxx xxxxxxxxxxxxxx. Ixxxxxx, xxxx’xx xxxxxxxxx xx xxxxxxxxx xxxxx xxxxx xx xxx xxxx xx xxxxxx xxxxxx xxxx xxx xxxxxxx. Txx xxxx xxxx xxxxxxxx xxx xxxxx xx xxxxxxxxxx xx xxxxx xxx xxxx xxxx xxxx.</para>
+      <sect2>
+        <title>More wrapping</title>
       <refentry id="appa-77011">
         <refmeta>
           <refentrytitle>CHAR</refentrytitle>
@@ -1282,6 +1284,7 @@ Txx <literal moreinfo="none">SET</literal> xxxx xxxx xx xxxxxxx xx <literal more
 </para>
         </refsect1>
       </refentry>
+    </sect2>
     </sect1>
   </appendix>
   <appendix id="mysqlian-APP-B">
index a11f3ebb8d0d63a22acedb4a3ea01eb7e9bec582..19c9c5f28f989ec86f17f953653f038799d97fd4 100644 (file)
       <!-- TODO: be nice to have a idref="titlepage" here -->
       <xsl:choose>
         <xsl:when test="$root.is.a.chunk != '0'">
-          <xsl:apply-templates select="/*" mode="opf.spine"/>
+          <xsl:apply-templates select="/*|//refentry" mode="opf.spine"/>
         </xsl:when>
         <xsl:otherwise>
-          <xsl:apply-templates select="/*/*" mode="opf.spine"/>
+          <xsl:apply-templates select="/*/*|//refentry" mode="opf.spine"/>
         </xsl:otherwise>
       </xsl:choose>