aboutsummaryrefslogtreecommitdiffstats
path: root/stylesheets/lfs-xsl/chunk-master.xsl
blob: cbdf140aeaecd3225e840bbb647414eb917313b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version='1.0' encoding='ISO-8859-1'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml"
                version="1.0">

  <!-- Top-level chunked code for normal processing.
       Import customized output templates.
       Include customized chunk templates.
       Replaces {docbook-xsl}/xhtml/chunk.xsl -->

  <!-- Our master non-chunking presentation templates -->
  <xsl:import href="chunk-slave.xsl"/>

  <!-- Upstream chunk code named templates -->
  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-common.xsl"/>

  <!-- Upstream chunk code match templates -->
  <xsl:include href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-code.xsl"/>

  <!-- Customized chunk templates -->
  <xsl:include href="xhtml/lfs-index.xsl"/>
  <xsl:include href="xhtml/lfs-legalnotice.xsl"/>
  <xsl:include href="xhtml/lfs-navigational.xsl"/>

  <!-- sect1:
         Prevent creation of dummy sect1 files used to emulate sub-chapters.
         The original template is in {docbook-xsl}/xhtml/chunk-code.xsl
         It also matches other sect* tags. The code for those tags are
         unchanged. -->
  <xsl:template match="sect1">
    <xsl:variable name="ischunk">
      <xsl:call-template name="chunk"/>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="@role = 'dummy'"/>
      <xsl:when test="not(parent::*)">
        <xsl:call-template name="process-chunk-element"/>
      </xsl:when>
      <xsl:when test="$ischunk = 0">
        <xsl:apply-imports/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="process-chunk-element"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>