2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: division.xsl 9366 2012-05-12 23:44:25Z bobstayton $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://docbook.sf.net/release/xsl/current/ for
11 copyright and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
17 <xsl:template match="set">
18 <xsl:call-template name="id.warning"/>
20 <xsl:element name="{$div.element}">
21 <xsl:apply-templates select="." mode="common.html.attributes"/>
22 <xsl:call-template name="id.attribute">
23 <xsl:with-param name="conditional" select="0"/>
25 <xsl:call-template name="dir">
26 <xsl:with-param name="inherit" select="1"/>
28 <xsl:call-template name="language.attribute"/>
29 <xsl:if test="$generate.id.attributes != 0">
30 <xsl:attribute name="id">
31 <xsl:call-template name="object.id"/>
35 <xsl:call-template name="set.titlepage"/>
37 <xsl:variable name="toc.params">
38 <xsl:call-template name="find.path.params">
39 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
43 <xsl:call-template name="make.lots">
44 <xsl:with-param name="toc.params" select="$toc.params"/>
45 <xsl:with-param name="toc">
46 <xsl:call-template name="set.toc">
47 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
52 <xsl:apply-templates/>
56 <xsl:template match="set/setinfo"></xsl:template>
57 <xsl:template match="set/title"></xsl:template>
58 <xsl:template match="set/titleabbrev"></xsl:template>
59 <xsl:template match="set/subtitle"></xsl:template>
61 <!-- ==================================================================== -->
63 <xsl:template match="book">
64 <xsl:call-template name="id.warning"/>
67 <xsl:apply-templates select="." mode="common.html.attributes"/>
68 <xsl:call-template name="id.attribute">
69 <xsl:with-param name="conditional" select="0"/>
72 <xsl:call-template name="book.titlepage"/>
74 <xsl:apply-templates select="dedication" mode="dedication"/>
75 <xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
77 <xsl:variable name="toc.params">
78 <xsl:call-template name="find.path.params">
79 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
83 <xsl:call-template name="make.lots">
84 <xsl:with-param name="toc.params" select="$toc.params"/>
85 <xsl:with-param name="toc">
86 <xsl:call-template name="division.toc">
87 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
92 <xsl:apply-templates/>
96 <xsl:template match="book/bookinfo"></xsl:template>
97 <xsl:template match="book/info"></xsl:template>
98 <xsl:template match="book/title"></xsl:template>
99 <xsl:template match="book/titleabbrev"></xsl:template>
100 <xsl:template match="book/subtitle"></xsl:template>
102 <!-- ==================================================================== -->
104 <xsl:template match="part">
105 <xsl:call-template name="id.warning"/>
108 <xsl:apply-templates select="." mode="common.html.attributes"/>
109 <xsl:call-template name="id.attribute">
110 <xsl:with-param name="conditional" select="0"/>
113 <xsl:call-template name="part.titlepage"/>
115 <xsl:variable name="toc.params">
116 <xsl:call-template name="find.path.params">
117 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
120 <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
121 <xsl:call-template name="division.toc"/>
123 <xsl:apply-templates/>
127 <xsl:template match="part" mode="make.part.toc">
128 <xsl:call-template name="division.toc"/>
131 <xsl:template match="reference" mode="make.part.toc">
132 <xsl:call-template name="division.toc"/>
135 <xsl:template match="part/docinfo"></xsl:template>
136 <xsl:template match="part/partinfo"></xsl:template>
137 <xsl:template match="part/info"></xsl:template>
138 <xsl:template match="part/title"></xsl:template>
139 <xsl:template match="part/titleabbrev"></xsl:template>
140 <xsl:template match="part/subtitle"></xsl:template>
142 <xsl:template match="partintro">
143 <xsl:call-template name="id.warning"/>
146 <xsl:call-template name="common.html.attributes"/>
147 <xsl:call-template name="id.attribute">
148 <xsl:with-param name="conditional" select="0"/>
151 <xsl:call-template name="partintro.titlepage"/>
152 <xsl:apply-templates/>
154 <xsl:variable name="toc.params">
155 <xsl:call-template name="find.path.params">
156 <xsl:with-param name="node" select="parent::*"/>
157 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
160 <xsl:if test="contains($toc.params, 'toc')">
161 <!-- not ancestor::part because partintro appears in reference -->
162 <xsl:apply-templates select="parent::*" mode="make.part.toc"/>
164 <xsl:call-template name="process.footnotes"/>
168 <xsl:template match="partintro/title"></xsl:template>
169 <xsl:template match="partintro/titleabbrev"></xsl:template>
170 <xsl:template match="partintro/subtitle"></xsl:template>
172 <xsl:template match="partintro/title" mode="partintro.title.mode">
174 <xsl:apply-templates/>
178 <xsl:template match="partintro/subtitle" mode="partintro.title.mode">
180 <i><xsl:apply-templates/></i>
184 <!-- ==================================================================== -->
186 <xsl:template match="book" mode="division.number">
187 <xsl:number from="set" count="book" format="1."/>
190 <xsl:template match="part" mode="division.number">
191 <xsl:number from="book" count="part" format="I."/>
194 <!-- ==================================================================== -->
196 <xsl:template name="division.title">
197 <xsl:param name="node" select="."/>
200 <xsl:attribute name="class">title</xsl:attribute>
201 <xsl:call-template name="anchor">
202 <xsl:with-param name="node" select="$node"/>
203 <xsl:with-param name="conditional" select="0"/>
205 <xsl:apply-templates select="$node" mode="object.title.markup">
206 <xsl:with-param name="allow-anchors" select="1"/>
207 </xsl:apply-templates>