OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Chunking XHTML without navigation for book "part" tags


Hi,

I have a book in the following format:

<book>
  <bookinfo> ... </bookinfo>
  <part>
    <title>First Part Title</title>
    <chapter id="html-filename-01">
      <title>First Chapter Title</title>
      <para>...</para>
    </chapter>
    <chapter id="html-filename-01">
      <title>Second Chapter Title</title>
      <para>...</para>
    </chapter>
  </part>
  <part><title>Second Part Title</title> ... </part>
  <part><title>Third Part Title</title> ... </part>
</book>

There are about 15 parts split across 90 chapters.

I'm using xmlto to generate the XHTML pages, and it works great:

  xmlto --skip-validation -m config.xsl xhtml book.xml -o docbook

The problem is that I'm trying to make the navigation links skip
seamlessly between chapters, ignoring the parts, while keeping the
chapter ids as file names (i.e., use.id.as.filename). Unfortunately,
the "next" link at the end of a part disappears. Without the
modifications I've made (see the attached config.xsl), the "next" link
directs to the next part of the book. I want it to skip the part and
link to the next chapter of the book (as though the parts didn't
exist).

I have to keep the parts because the table of contents should include
the different book parts.

I tried using a layout of book :: chapter :: section (instead of book
:: part :: chapter), but then I wasn't able to generate the
appropriate file names.

My question is this:

When chunking a DocBook into XHTML format, how can book part tags be
skipped from the navigation, but retained for the main TOC?

Thank you!
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
  <xsl:param name="use.id.as.filename" select="1" />
  <xsl:param name="suppress.header.navigation" select="1" />
  <xsl:param name="suppress.footer.navigation" select="1" />
  <xsl:param name="emphasis.propagates.style" select="1" />
  <xsl:param name="table.borders.with.css" select="1" />
  <xsl:param name="navig.showtitles" select="0" />
  <xsl:param name="footer.rule" select="0" />
  <xsl:param name="chapter.autolabel" select="0" />
  <xsl:param name="section.autolabel" select="0" />
  <xsl:param name="part.autolabel" select="0" />
  <xsl:param name="html.extra.head.links" select="0" />

  <xsl:param name="html.stylesheet">facts.css</xsl:param>

<xsl:param name="generate.toc">
book      toc,title
chapter   toc,title
part      nop
section   nop
</xsl:param>

<!--
 | Replace the standard navigation with table-less custom image links. For
 | example:
 |
 | <div class="navigation">
 |   <div class="nav-next">
 |     <a href="next-chapter.html"><img src="images/next.png" ... /></a>
 |   </div>
 |   <div class="nav-prev"> ... </div>
 | </div>
 +-->
<xsl:template name="header.navigation">
  <xsl:param name="prev" />
  <xsl:param name="next" />
  <xsl:param name="nav.context" />
<div class="navigation">
  <xsl:apply-templates select="$prev" mode="prev" />
  <xsl:apply-templates select="$next" mode="next" />
</div>
</xsl:template>

<xsl:template name="links">
  <xsl:param name="advance" />
  <xsl:param name="file" />

  <div class="nav-{$advance}">
    <a href="{$file}.html" title="{$advance}"><img src="images/{$advance}.png" alt="{$advance}" border="0" /></a>
  </div>
</xsl:template>

<xsl:template match="chapter" mode="prev">
  <xsl:call-template name="links">
    <xsl:with-param name="advance" select="'prev'" />
    <xsl:with-param name="file" select="@id" />
  </xsl:call-template>
</xsl:template>

<!-- Apply the chapter links. -->
<xsl:template match="chapter" mode="next">
  <xsl:call-template name="links">
    <xsl:with-param name="advance" select="'next'" />
    <xsl:with-param name="file" select="@id" />
  </xsl:call-template>
</xsl:template>

<xsl:template match="*" mode="prev">
</xsl:template>

<xsl:template match="*" mode="next">
</xsl:template>

<!-- Custom copyright notice in the footer. -->
<xsl:template name="user.footer.content">
<div class="copyright">
  <xsl:apply-templates select="//copyright" mode="titlepage.mode"/>
  <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/";>CC-BY-NC-SA</a>
</div>
</xsl:template>

<xsl:template match="copyright" mode="titlepage.mode">
  <xsl:apply-templates select="year" mode="titlepage.mode" />
  <xsl:apply-templates select="holder" mode="titlepage.mode" />
</xsl:template>

<xsl:template match="year" mode="titlepage.mode">
  Copyright &#169; <xsl:apply-templates /> <xsl:text> </xsl:text>
</xsl:template>

<xsl:template match="holder" mode="titlepage.mode">
  <a href="mailto:{.}";><xsl:value-of select="." /></a> <xsl:text> </xsl:text>
</xsl:template>

</xsl:stylesheet>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]