1 <?xml version=
"1.0"?> <!-- -*- sgml -*- -->
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
4 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
5 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
6 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/manifest.xsl"/>
7 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/chunk-code.xsl"/>
10 <!-- Note [Dec.1 2005]: the tempate 'chunk-code.xsl' in -->
11 <!-- '/usr/share/xml/docbook/stylesheet/nwalsh/1.69.0/html/' -->
12 <!-- has been edited to remove 'article' and 'refentry' -->
13 <!-- so that separate titlepages don't get generated for them -->
14 <!-- Note [Dec.1 2005, JRS]: ../1.69.0/.. was changed to -->
15 <!-- ../current/.. in docs/Makefile.am, since the latter is a -->
16 <!-- symlink to the former, at least on SuSE 10.0. -->
18 <!-- use UTF-8 encoding -->
19 <xsl:output method=
"html" encoding=
"UTF-8" indent=
"yes"/>
21 <!-- set various parameters -->
22 <xsl:param name=
"use.id.as.filename" select=
"'1'"/>
23 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
24 <!-- set chunking at the chapter level only -->
25 <xsl:param name=
"chunk.section.depth" select=
"'0'"/>
26 <!-- set toc-levels -->
27 <xsl:param name=
"generate.toc">
29 book toc,title,figure,table,example,equation
47 <!-- properties common to html + fo ................................... -->
49 <!-- we like '1.2 Title' -->
50 <xsl:param name=
"section.autolabel" select=
"'1'"/>
51 <xsl:param name=
"section.label.includes.component.label" select=
"'1'"/>
53 <!-- Do not put 'Chapter' at the start of eg 'Chapter 1. Doing This' -->
54 <xsl:param name=
"local.l10n.xml" select=
"document('')"/>
55 <l:i18n xmlns:
l=
"http://docbook.sourceforge.net/xmlns/l10n/1.0">
56 <l:l10n language=
"en">
57 <l:context name=
"title-numbered">
58 <l:template name=
"chapter" text=
"%n. %t"/>
63 <!-- per Bob Stayton: turn off xml:base processing pro tem -->
64 <!-- should hopefully be fixed in next docbook stylesheets release (1.70) -->
65 <xsl:template match=
"@fileref">
66 <xsl:value-of select=
"."/>
69 <!-- end properties common to html + fo ............................... -->
72 <!-- center everything at the top of a titlepage -->
73 <xsl:attribute-set name=
"set.titlepage.recto.style">
74 <xsl:attribute name=
"align">center
</xsl:attribute>
78 <!-- don`t put an expanded set-level TOC, only book titles -->
79 <xsl:template match=
"book" mode=
"toc">
80 <xsl:param name=
"toc-context" select=
"."/>
82 <xsl:when test=
"local-name($toc-context) = 'set'">
83 <xsl:call-template name=
"subtoc">
84 <xsl:with-param name=
"toc-context" select=
"$toc-context"/>
85 <xsl:with-param name=
"nodes" select=
"foo"/>
89 <xsl:call-template name=
"subtoc">
90 <xsl:with-param name=
"toc-context" select=
"$toc-context"/>
91 <xsl:with-param name=
"nodes" select=
"part|reference
92 |preface|chapter|appendix
94 |bibliography|glossary|index
96 |bridgehead[$bridgehead.in.toc !=
104 <!-- custom footer -->
105 <xsl:template name=
"footer.navigation">
106 <xsl:param name=
"prev" select=
"/foo"/>
107 <xsl:param name=
"next" select=
"/foo"/>
108 <xsl:param name=
"nav.context"/>
110 <xsl:variable name=
"home" select=
"/*[1]"/>
111 <xsl:variable name=
"up" select=
"parent::*"/>
113 <xsl:variable name=
"row1" select=
"count($prev) > 0
115 or count($next) > 0"/>
117 <xsl:variable name=
"row2" select=
"($prev != 0)
118 or (generate-id($home) != generate-id(.) or $nav.context = 'toc')
119 or ($chunk.tocs.and.lots != 0 and $nav.context != 'toc')
122 <xsl:if test=
"$row1 or $row2">
124 <table class=
"nav" width=
"100%" cellspacing=
"3" cellpadding=
"2" border=
"0" summary=
"Navigation footer">
125 <xsl:if test=
"$row1">
127 <td rowspan=
"2" width=
"40%" align=
"left">
128 <xsl:if test=
"count($prev)>0">
130 <xsl:attribute name=
"href">
131 <xsl:call-template name=
"href.target">
132 <xsl:with-param name=
"object" select=
"$prev"/>
135 <xsl:text><< </xsl:text>
136 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
139 <xsl:text> </xsl:text>
141 <td width=
"20%" align=
"center">
143 <xsl:when test=
"count($up)>0">
145 <xsl:attribute name=
"href">
146 <xsl:call-template name=
"href.target">
147 <xsl:with-param name=
"object" select=
"$up"/>
150 <xsl:call-template name=
"navig.content">
151 <xsl:with-param name=
"direction" select=
"'up'"/>
155 <xsl:otherwise> </xsl:otherwise>
158 <td rowspan=
"2" width=
"40%" align=
"right">
159 <xsl:text> </xsl:text>
160 <xsl:if test=
"count($next)>0">
162 <xsl:attribute name=
"href">
163 <xsl:call-template name=
"href.target">
164 <xsl:with-param name=
"object" select=
"$next"/>
167 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>
168 <xsl:text> >></xsl:text>
174 <xsl:if test=
"$row2">
176 <td width=
"20%" align=
"center">
178 <xsl:when test=
"$home != . or $nav.context = 'toc'">
180 <xsl:attribute name=
"href">
181 <xsl:call-template name=
"href.target">
182 <xsl:with-param name=
"object" select=
"$home"/>
185 <xsl:call-template name=
"navig.content">
186 <xsl:with-param name=
"direction" select=
"'home'"/>
189 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
190 <xsl:text> |
 </xsl:text>
193 <xsl:otherwise> </xsl:otherwise>
195 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
197 <xsl:attribute name=
"href">
198 <xsl:apply-templates select=
"/*[1]" mode=
"recursive-chunk-filename"/>
199 <xsl:text>-toc
</xsl:text>
200 <xsl:value-of select=
"$html.ext"/>
202 <xsl:call-template name=
"gentext">
203 <xsl:with-param name=
"key" select=
"'nav-toc'"/>
216 <!-- qandaset styles -->
217 <!-- these templates have been carefully tweaked to correct the -->
218 <!-- horrible mess that docbook makes of dl/dt/dd tags. Edit with care -->
219 <xsl:template match=
"qandaset">
220 <xsl:variable name=
"title" select=
"(blockinfo/title|title)[1]"/>
221 <xsl:variable name=
"toc">
222 <xsl:call-template name=
"dbhtml-attribute">
223 <xsl:with-param name=
"pis" select=
"processing-instruction('dbhtml')"/>
224 <xsl:with-param name=
"attribute" select=
"'toc'"/>
228 <xsl:variable name=
"toc.params">
229 <xsl:call-template name=
"find.path.params">
230 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
234 <div class=
"{name(.)}">
235 <xsl:apply-templates select=
"$title"/>
236 <xsl:if test=
"(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
237 <xsl:call-template name=
"process.qanda.toc"/>
239 <xsl:apply-templates select=
"qandaentry|qandadiv"/>
244 <xsl:template match=
"qandadiv">
246 <table width=
"100%" summary=
"Q and A Div" cellpadding=
"2" cellspacing=
"2" border=
"0">
247 <xsl:if test=
"blockinfo/title|title">
248 <tr class=
"qandadiv">
249 <td align=
"left" valign=
"top" colspan=
"2">
250 <xsl:call-template name=
"anchor">
251 <xsl:with-param name=
"conditional" select=
"0"/>
253 <xsl:apply-templates select=
"(blockinfo/title|title)[1]"/>
258 <xsl:variable name=
"toc">
259 <xsl:call-template name=
"dbhtml-attribute">
260 <xsl:with-param name=
"pis"
261 select=
"processing-instruction('dbhtml')"/>
262 <xsl:with-param name=
"attribute" select=
"'toc'"/>
266 <xsl:variable name=
"toc.params">
267 <xsl:call-template name=
"find.path.params">
268 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
272 <xsl:if test=
"(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
273 <tr class=
"toc" colspan=
"2">
274 <td align=
"left" valign=
"top" colspan=
"2">
275 <xsl:call-template name=
"process.myqanda.toc"/>
279 <xsl:apply-templates select=
"qandadiv|qandaentry"/>
284 <!-- put questions in bold -->
285 <xsl:template match=
"question/para">
286 <b><xsl:apply-templates/></b>
289 <xsl:template match=
"question">
290 <xsl:variable name=
"deflabel">
292 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
293 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
297 <xsl:value-of select=
"$qanda.defaultlabel"/>
301 <tr><td colspan=
"2"><xsl:text> </xsl:text></td></tr>
302 <tr class=
"{name(.)}">
303 <td align=
"left" valign=
"top">
304 <xsl:call-template name=
"anchor">
305 <xsl:with-param name=
"node" select=
".."/>
306 <xsl:with-param name=
"conditional" select=
"0"/>
308 <xsl:call-template name=
"anchor">
309 <xsl:with-param name=
"conditional" select=
"0"/>
312 <xsl:apply-templates select=
"." mode=
"label.markup"/>
313 <xsl:if test=
"$deflabel = 'number' and not(label)">
314 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
318 <td align=
"left" valign=
"top">
320 <xsl:when test=
"$deflabel = 'none' and not(label)">
321 <b><xsl:apply-templates select=
"*[name(.) != 'label']"/></b>
324 <xsl:apply-templates select=
"*[name(.) != 'label']"/>
332 <xsl:template name=
"process.myqanda.toc">
333 <xsl:apply-templates select=
"qandadiv" mode=
"qandatoc.mode"/>
334 <xsl:apply-templates select=
"qandaentry" mode=
"myqandatoc.mode"/>
338 <xsl:template name=
"process.qanda.toc">
339 <xsl:apply-templates select=
"qandadiv" mode=
"qandatoc.mode"/>
340 <xsl:apply-templates select=
"qandaentry" mode=
"qandatoc.mode"/>
344 <xsl:template match=
"qandadiv" mode=
"qandatoc.mode">
346 <dt><xsl:apply-templates select=
"title" mode=
"qandatoc.mode"/></dt>
347 <xsl:call-template name=
"process.qanda.toc"/>
352 <!-- this one is used at the top of the page -->
353 <xsl:template match=
"question" mode=
"qandatoc.mode">
354 <xsl:variable name=
"firstch" select=
"(*[name(.)!='label'])[1]"/>
355 <xsl:variable name=
"deflabel">
357 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
358 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
362 <xsl:value-of select=
"$qanda.defaultlabel"/>
367 <xsl:apply-templates select=
"." mode=
"label.markup"/>
368 <xsl:if test=
"$deflabel = 'number' and not(label)">
369 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
371 <xsl:text> </xsl:text>
373 <xsl:attribute name=
"href">
374 <xsl:call-template name=
"href.target">
375 <xsl:with-param name=
"object" select=
".."/>
378 <xsl:value-of select=
"$firstch"/>
384 <!-- this one is used within table cells -->
385 <xsl:template match=
"qandaentry" mode=
"myqandatoc.mode">
386 <xsl:apply-templates select=
"question" mode=
"myqandatoc.mode"/>
389 <xsl:template match=
"question" mode=
"myqandatoc.mode">
390 <xsl:variable name=
"firstch" select=
"(*[name(.)!='label'])[1]"/>
391 <xsl:variable name=
"deflabel">
393 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
394 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
398 <xsl:value-of select=
"$qanda.defaultlabel"/>
402 <xsl:apply-templates select=
"." mode=
"label.markup"/>
403 <xsl:if test=
"$deflabel = 'number' and not(label)">
404 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
406 <xsl:text> </xsl:text>
408 <xsl:attribute name=
"href">
409 <xsl:call-template name=
"href.target">
410 <xsl:with-param name=
"object" select=
".."/>
413 <xsl:value-of select=
"$firstch"/>