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. -->
19 <!-- use 8859-1 encoding -->
20 <xsl:output method=
"html" encoding=
"ISO-8859-1" indent=
"yes"/>
22 <!-- set various parameters -->
23 <xsl:param name=
"use.id.as.filename" select=
"'1'"/>
24 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
25 <!-- set chunking at the chapter level only -->
26 <xsl:param name=
"chunk.section.depth" select=
"'0'"/>
27 <!-- set toc-levels -->
28 <xsl:param name=
"generate.toc">
30 book toc,title,figure,table,example,equation
48 <!-- properties common to html + fo ................................... -->
50 <!-- we like '1.2 Title' -->
51 <xsl:param name=
"section.autolabel" select=
"'1'"/>
52 <xsl:param name=
"section.label.includes.component.label" select=
"'1'"/>
54 <!-- Do not put 'Chapter' at the start of eg 'Chapter 1. Doing This' -->
55 <xsl:param name=
"local.l10n.xml" select=
"document('')"/>
56 <l:i18n xmlns:
l=
"http://docbook.sourceforge.net/xmlns/l10n/1.0">
57 <l:l10n language=
"en">
58 <l:context name=
"title-numbered">
59 <l:template name=
"chapter" text=
"%n. %t"/>
64 <!-- per Bob Stayton: turn off xml:base processing pro tem -->
65 <!-- should hopefully be fixed in next docbook stylesheets release (1.70) -->
66 <xsl:template match=
"@fileref">
67 <xsl:value-of select=
"."/>
70 <!-- end properties common to html + fo ............................... -->
73 <!-- center everything at the top of a titlepage -->
74 <xsl:attribute-set name=
"set.titlepage.recto.style">
75 <xsl:attribute name=
"align">center
</xsl:attribute>
79 <!-- don`t put an expanded set-level TOC, only book titles -->
80 <xsl:template match=
"book" mode=
"toc">
81 <xsl:param name=
"toc-context" select=
"."/>
83 <xsl:when test=
"local-name($toc-context) = 'set'">
84 <xsl:call-template name=
"subtoc">
85 <xsl:with-param name=
"toc-context" select=
"$toc-context"/>
86 <xsl:with-param name=
"nodes" select=
"foo"/>
90 <xsl:call-template name=
"subtoc">
91 <xsl:with-param name=
"toc-context" select=
"$toc-context"/>
92 <xsl:with-param name=
"nodes" select=
"part|reference
93 |preface|chapter|appendix
95 |bibliography|glossary|index
97 |bridgehead[$bridgehead.in.toc !=
105 <!-- custom footer -->
106 <xsl:template name=
"footer.navigation">
107 <xsl:param name=
"prev" select=
"/foo"/>
108 <xsl:param name=
"next" select=
"/foo"/>
109 <xsl:param name=
"nav.context"/>
111 <xsl:variable name=
"home" select=
"/*[1]"/>
112 <xsl:variable name=
"up" select=
"parent::*"/>
114 <xsl:variable name=
"row1" select=
"count($prev) > 0
116 or count($next) > 0"/>
118 <xsl:variable name=
"row2" select=
"($prev != 0)
119 or (generate-id($home) != generate-id(.) or $nav.context = 'toc')
120 or ($chunk.tocs.and.lots != 0 and $nav.context != 'toc')
123 <xsl:if test=
"$row1 or $row2">
125 <table class=
"nav" width=
"100%" cellspacing=
"3" cellpadding=
"2" border=
"0" summary=
"Navigation footer">
126 <xsl:if test=
"$row1">
128 <td rowspan=
"2" width=
"40%" align=
"left">
129 <xsl:if test=
"count($prev)>0">
131 <xsl:attribute name=
"href">
132 <xsl:call-template name=
"href.target">
133 <xsl:with-param name=
"object" select=
"$prev"/>
136 <xsl:text><< </xsl:text>
137 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
140 <xsl:text> </xsl:text>
142 <td width=
"20%" align=
"center">
144 <xsl:when test=
"count($up)>0">
146 <xsl:attribute name=
"href">
147 <xsl:call-template name=
"href.target">
148 <xsl:with-param name=
"object" select=
"$up"/>
151 <xsl:call-template name=
"navig.content">
152 <xsl:with-param name=
"direction" select=
"'up'"/>
156 <xsl:otherwise> </xsl:otherwise>
159 <td rowspan=
"2" width=
"40%" align=
"right">
160 <xsl:text> </xsl:text>
161 <xsl:if test=
"count($next)>0">
163 <xsl:attribute name=
"href">
164 <xsl:call-template name=
"href.target">
165 <xsl:with-param name=
"object" select=
"$next"/>
168 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>
169 <xsl:text> >></xsl:text>
175 <xsl:if test=
"$row2">
177 <td width=
"20%" align=
"center">
179 <xsl:when test=
"$home != . or $nav.context = 'toc'">
181 <xsl:attribute name=
"href">
182 <xsl:call-template name=
"href.target">
183 <xsl:with-param name=
"object" select=
"$home"/>
186 <xsl:call-template name=
"navig.content">
187 <xsl:with-param name=
"direction" select=
"'home'"/>
190 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
191 <xsl:text> |
 </xsl:text>
194 <xsl:otherwise> </xsl:otherwise>
196 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
198 <xsl:attribute name=
"href">
199 <xsl:apply-templates select=
"/*[1]" mode=
"recursive-chunk-filename"/>
200 <xsl:text>-toc
</xsl:text>
201 <xsl:value-of select=
"$html.ext"/>
203 <xsl:call-template name=
"gentext">
204 <xsl:with-param name=
"key" select=
"'nav-toc'"/>
217 <!-- qandaset styles -->
218 <!-- these templates have been carefully tweaked to correct the -->
219 <!-- horrible mess that docbook makes of dl/dt/dd tags. Edit with care -->
220 <xsl:template match=
"qandaset">
221 <xsl:variable name=
"title" select=
"(blockinfo/title|title)[1]"/>
222 <xsl:variable name=
"toc">
223 <xsl:call-template name=
"dbhtml-attribute">
224 <xsl:with-param name=
"pis" select=
"processing-instruction('dbhtml')"/>
225 <xsl:with-param name=
"attribute" select=
"'toc'"/>
229 <xsl:variable name=
"toc.params">
230 <xsl:call-template name=
"find.path.params">
231 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
235 <div class=
"{name(.)}">
236 <xsl:apply-templates select=
"$title"/>
237 <xsl:if test=
"(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
238 <xsl:call-template name=
"process.qanda.toc"/>
240 <xsl:apply-templates select=
"qandaentry|qandadiv"/>
245 <xsl:template match=
"qandadiv">
247 <table width=
"100%" summary=
"Q and A Div" cellpadding=
"2" cellspacing=
"2" border=
"0">
248 <xsl:if test=
"blockinfo/title|title">
249 <tr class=
"qandadiv">
250 <td align=
"left" valign=
"top" colspan=
"2">
251 <xsl:call-template name=
"anchor">
252 <xsl:with-param name=
"conditional" select=
"0"/>
254 <xsl:apply-templates select=
"(blockinfo/title|title)[1]"/>
259 <xsl:variable name=
"toc">
260 <xsl:call-template name=
"dbhtml-attribute">
261 <xsl:with-param name=
"pis"
262 select=
"processing-instruction('dbhtml')"/>
263 <xsl:with-param name=
"attribute" select=
"'toc'"/>
267 <xsl:variable name=
"toc.params">
268 <xsl:call-template name=
"find.path.params">
269 <xsl:with-param name=
"table" select=
"normalize-space($generate.toc)"/>
273 <xsl:if test=
"(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
274 <tr class=
"toc" colspan=
"2">
275 <td align=
"left" valign=
"top" colspan=
"2">
276 <xsl:call-template name=
"process.myqanda.toc"/>
280 <xsl:apply-templates select=
"qandadiv|qandaentry"/>
285 <!-- put questions in bold -->
286 <xsl:template match=
"question/para">
287 <b><xsl:apply-templates/></b>
290 <xsl:template match=
"question">
291 <xsl:variable name=
"deflabel">
293 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
294 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
298 <xsl:value-of select=
"$qanda.defaultlabel"/>
302 <tr><td colspan=
"2"><xsl:text> </xsl:text></td></tr>
303 <tr class=
"{name(.)}">
304 <td align=
"left" valign=
"top">
305 <xsl:call-template name=
"anchor">
306 <xsl:with-param name=
"node" select=
".."/>
307 <xsl:with-param name=
"conditional" select=
"0"/>
309 <xsl:call-template name=
"anchor">
310 <xsl:with-param name=
"conditional" select=
"0"/>
313 <xsl:apply-templates select=
"." mode=
"label.markup"/>
314 <xsl:if test=
"$deflabel = 'number' and not(label)">
315 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
319 <td align=
"left" valign=
"top">
321 <xsl:when test=
"$deflabel = 'none' and not(label)">
322 <b><xsl:apply-templates select=
"*[name(.) != 'label']"/></b>
325 <xsl:apply-templates select=
"*[name(.) != 'label']"/>
333 <xsl:template name=
"process.myqanda.toc">
334 <xsl:apply-templates select=
"qandadiv" mode=
"qandatoc.mode"/>
335 <xsl:apply-templates select=
"qandaentry" mode=
"myqandatoc.mode"/>
339 <xsl:template name=
"process.qanda.toc">
340 <xsl:apply-templates select=
"qandadiv" mode=
"qandatoc.mode"/>
341 <xsl:apply-templates select=
"qandaentry" mode=
"qandatoc.mode"/>
345 <xsl:template match=
"qandadiv" mode=
"qandatoc.mode">
347 <dt><xsl:apply-templates select=
"title" mode=
"qandatoc.mode"/></dt>
348 <xsl:call-template name=
"process.qanda.toc"/>
353 <!-- this one is used at the top of the page -->
354 <xsl:template match=
"question" mode=
"qandatoc.mode">
355 <xsl:variable name=
"firstch" select=
"(*[name(.)!='label'])[1]"/>
356 <xsl:variable name=
"deflabel">
358 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
359 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
363 <xsl:value-of select=
"$qanda.defaultlabel"/>
368 <xsl:apply-templates select=
"." mode=
"label.markup"/>
369 <xsl:if test=
"$deflabel = 'number' and not(label)">
370 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
372 <xsl:text> </xsl:text>
374 <xsl:attribute name=
"href">
375 <xsl:call-template name=
"href.target">
376 <xsl:with-param name=
"object" select=
".."/>
379 <xsl:value-of select=
"$firstch"/>
385 <!-- this one is used within table cells -->
386 <xsl:template match=
"qandaentry" mode=
"myqandatoc.mode">
387 <xsl:apply-templates select=
"question" mode=
"myqandatoc.mode"/>
390 <xsl:template match=
"question" mode=
"myqandatoc.mode">
391 <xsl:variable name=
"firstch" select=
"(*[name(.)!='label'])[1]"/>
392 <xsl:variable name=
"deflabel">
394 <xsl:when test=
"ancestor-or-self::*[@defaultlabel]">
395 <xsl:value-of select=
"(ancestor-or-self::*[@defaultlabel])[last()]
399 <xsl:value-of select=
"$qanda.defaultlabel"/>
403 <xsl:apply-templates select=
"." mode=
"label.markup"/>
404 <xsl:if test=
"$deflabel = 'number' and not(label)">
405 <xsl:apply-templates select=
"." mode=
"intralabel.punctuation"/>
407 <xsl:text> </xsl:text>
409 <xsl:attribute name=
"href">
410 <xsl:call-template name=
"href.target">
411 <xsl:with-param name=
"object" select=
".."/>
414 <xsl:value-of select=
"$firstch"/>