2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: division.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
17 <xsl:template match=
"set">
18 <xsl:call-template name=
"id.warning"/>
21 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
22 <xsl:call-template name=
"dir">
23 <xsl:with-param name=
"inherit" select=
"1"/>
25 <xsl:call-template name=
"language.attribute"/>
26 <xsl:if test=
"$generate.id.attributes != 0">
27 <xsl:attribute name=
"id">
28 <xsl:call-template name=
"object.id"/>
32 <xsl:call-template name=
"set.titlepage"/>
34 <xsl:variable name=
"toc.params">
35 <xsl:call-template name=
"find.path.params">
36 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
40 <xsl:call-template name=
"make.lots">
41 <xsl:with-param name=
"toc.params" select=
"$toc.params"/>
42 <xsl:with-param name=
"toc">
43 <xsl:call-template name=
"set.toc">
44 <xsl:with-param name=
"toc.title.p" select=
"contains($toc.params, 'title')"/>
49 <xsl:apply-templates/>
53 <xsl:template match=
"set/setinfo"></xsl:template>
54 <xsl:template match=
"set/title"></xsl:template>
55 <xsl:template match=
"set/titleabbrev"></xsl:template>
56 <xsl:template match=
"set/subtitle"></xsl:template>
58 <!-- ==================================================================== -->
60 <xsl:template match=
"book">
61 <xsl:call-template name=
"id.warning"/>
64 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
65 <xsl:call-template name=
"dir">
66 <xsl:with-param name=
"inherit" select=
"1"/>
68 <xsl:call-template name=
"language.attribute"/>
69 <xsl:if test=
"$generate.id.attributes != 0">
70 <xsl:attribute name=
"id">
71 <xsl:call-template name=
"object.id"/>
75 <xsl:call-template name=
"book.titlepage"/>
77 <xsl:apply-templates select=
"dedication" mode=
"dedication"/>
79 <xsl:variable name=
"toc.params">
80 <xsl:call-template name=
"find.path.params">
81 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
85 <xsl:call-template name=
"make.lots">
86 <xsl:with-param name=
"toc.params" select=
"$toc.params"/>
87 <xsl:with-param name=
"toc">
88 <xsl:call-template name=
"division.toc">
89 <xsl:with-param name=
"toc.title.p" select=
"contains($toc.params, 'title')"/>
94 <xsl:apply-templates/>
98 <xsl:template match=
"book/bookinfo"></xsl:template>
99 <xsl:template match=
"book/info"></xsl:template>
100 <xsl:template match=
"book/title"></xsl:template>
101 <xsl:template match=
"book/titleabbrev"></xsl:template>
102 <xsl:template match=
"book/subtitle"></xsl:template>
104 <!-- ==================================================================== -->
106 <xsl:template match=
"part">
107 <xsl:call-template name=
"id.warning"/>
110 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
111 <xsl:call-template name=
"dir">
112 <xsl:with-param name=
"inherit" select=
"1"/>
114 <xsl:call-template name=
"language.attribute"/>
115 <xsl:if test=
"$generate.id.attributes != 0">
116 <xsl:attribute name=
"id">
117 <xsl:call-template name=
"object.id"/>
121 <xsl:call-template name=
"part.titlepage"/>
123 <xsl:variable name=
"toc.params">
124 <xsl:call-template name=
"find.path.params">
125 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
128 <xsl:if test=
"not(partintro) and contains($toc.params, 'toc')">
129 <xsl:call-template name=
"division.toc"/>
131 <xsl:apply-templates/>
135 <xsl:template match=
"part" mode=
"make.part.toc">
136 <xsl:call-template name=
"division.toc"/>
139 <xsl:template match=
"reference" mode=
"make.part.toc">
140 <xsl:call-template name=
"division.toc"/>
143 <xsl:template match=
"part/docinfo"></xsl:template>
144 <xsl:template match=
"part/partinfo"></xsl:template>
145 <xsl:template match=
"part/info"></xsl:template>
146 <xsl:template match=
"part/title"></xsl:template>
147 <xsl:template match=
"part/titleabbrev"></xsl:template>
148 <xsl:template match=
"part/subtitle"></xsl:template>
150 <xsl:template match=
"partintro">
151 <xsl:call-template name=
"id.warning"/>
154 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
155 <xsl:call-template name=
"dir">
156 <xsl:with-param name=
"inherit" select=
"1"/>
158 <xsl:call-template name=
"language.attribute"/>
159 <xsl:if test=
"$generate.id.attributes != 0">
160 <xsl:attribute name=
"id">
161 <xsl:call-template name=
"object.id"/>
165 <xsl:call-template name=
"partintro.titlepage"/>
166 <xsl:apply-templates/>
168 <xsl:variable name=
"toc.params">
169 <xsl:call-template name=
"find.path.params">
170 <xsl:with-param name=
"node" select=
"parent::*"/>
171 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
174 <xsl:if test=
"contains($toc.params, 'toc')">
175 <!-- not ancestor::part because partintro appears in reference -->
176 <xsl:apply-templates select=
"parent::*" mode=
"make.part.toc"/>
178 <xsl:call-template name=
"process.footnotes"/>
182 <xsl:template match=
"partintro/title"></xsl:template>
183 <xsl:template match=
"partintro/titleabbrev"></xsl:template>
184 <xsl:template match=
"partintro/subtitle"></xsl:template>
186 <xsl:template match=
"partintro/title" mode=
"partintro.title.mode">
188 <xsl:apply-templates/>
192 <xsl:template match=
"partintro/subtitle" mode=
"partintro.title.mode">
194 <i><xsl:apply-templates/></i>
198 <!-- ==================================================================== -->
200 <xsl:template match=
"book" mode=
"division.number">
201 <xsl:number from=
"set" count=
"book" format=
"1."/>
204 <xsl:template match=
"part" mode=
"division.number">
205 <xsl:number from=
"book" count=
"part" format=
"I."/>
208 <!-- ==================================================================== -->
210 <xsl:template name=
"division.title">
211 <xsl:param name=
"node" select=
"."/>
214 <xsl:attribute name=
"class">title
</xsl:attribute>
215 <xsl:call-template name=
"anchor">
216 <xsl:with-param name=
"node" select=
"$node"/>
217 <xsl:with-param name=
"conditional" select=
"0"/>
219 <xsl:apply-templates select=
"$node" mode=
"object.title.markup">
220 <xsl:with-param name=
"allow-anchors" select=
"1"/>
221 </xsl:apply-templates>