2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
4 xmlns=
"http://www.w3.org/1999/xhtml">
6 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
7 <xsl:include href=
"stylesheet-common.xsl" />
8 <xsl:include href=
"stylesheet-html-common.xsl" />
9 <xsl:include href=
"stylesheet-speedup-xhtml.xsl" />
13 <xsl:param name=
"base.dir" select=
"'html/'"></xsl:param>
14 <xsl:param name=
"use.id.as.filename" select=
"'1'"></xsl:param>
15 <xsl:param name=
"generate.legalnotice.link" select=
"1"></xsl:param>
16 <xsl:param name=
"chunk.first.sections" select=
"1"/>
17 <xsl:param name=
"chunk.quietly" select=
"1"></xsl:param>
18 <xsl:param name=
"admon.style"></xsl:param> <!-- handled by CSS stylesheet -->
21 <!-- copy images to the output directory, so the output is self contained -->
22 <xsl:template match=
"imageobject">
23 <xsl:call-template name=
"write-image"/>
24 <xsl:apply-templates select=
"imagedata"/>
27 <!-- strip directory name from image filerefs -->
28 <xsl:template match=
"imagedata/@fileref">
29 <xsl:value-of select=
"substring-after(., '/')"/>
34 Customization of header
35 - add Up and Home links
36 - add tool tips to links
38 (overrides html/chunk-common.xsl)
40 <xsl:template name=
"header.navigation">
41 <xsl:param name=
"prev" select=
"/foo"/>
42 <xsl:param name=
"next" select=
"/foo"/>
43 <xsl:param name=
"nav.context"/>
45 <xsl:variable name=
"home" select=
"/*[1]"/>
46 <xsl:variable name=
"up" select=
"parent::*"/>
48 <xsl:variable name=
"row1" select=
"$navig.showtitles != 0"/>
49 <xsl:variable name=
"row2" select=
"count($prev) > 0
51 and $navig.showtitles != 0)
52 or count($next) > 0"/>
54 <xsl:if test=
"$suppress.navigation = '0' and $suppress.header.navigation = '0'">
55 <div class=
"navheader">
56 <xsl:if test=
"$row1 or $row2">
57 <table width=
"100%" summary=
"Navigation header">
60 <th colspan=
"5" align=
"center">
61 <xsl:apply-templates select=
"." mode=
"object.title.markup"/>
68 <td width=
"10%" align=
"{$direction.align.start}">
69 <xsl:if test=
"count($prev)>0">
71 <xsl:attribute name=
"href">
72 <xsl:call-template name=
"href.target">
73 <xsl:with-param name=
"object" select=
"$prev"/>
76 <xsl:attribute name=
"title">
77 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
79 <xsl:call-template name=
"navig.content">
80 <xsl:with-param name=
"direction" select=
"'prev'"/>
84 <xsl:text> </xsl:text>
86 <td width=
"10%" align=
"{$direction.align.start}">
88 <xsl:when test=
"count($up)>0">
90 <xsl:attribute name=
"href">
91 <xsl:call-template name=
"href.target">
92 <xsl:with-param name=
"object" select=
"$up"/>
95 <xsl:attribute name=
"title">
96 <xsl:apply-templates select=
"$up" mode=
"object.title.markup"/>
98 <xsl:call-template name=
"navig.content">
99 <xsl:with-param name=
"direction" select=
"'up'"/>
103 <xsl:otherwise> </xsl:otherwise>
106 <th width=
"60%" align=
"center">
108 <xsl:when test=
"count($up) > 0
109 and $navig.showtitles != 0">
110 <xsl:apply-templates select=
"$up" mode=
"object.title.markup"/>
112 <xsl:otherwise> </xsl:otherwise>
115 <td width=
"10%" align=
"{$direction.align.end}">
117 <xsl:when test=
"$home != . or $nav.context = 'toc'">
119 <xsl:attribute name=
"href">
120 <xsl:call-template name=
"href.target">
121 <xsl:with-param name=
"object" select=
"$home"/>
124 <xsl:attribute name=
"title">
125 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
127 <xsl:call-template name=
"navig.content">
128 <xsl:with-param name=
"direction" select=
"'home'"/>
131 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
132 <xsl:text> |
 </xsl:text>
135 <xsl:otherwise> </xsl:otherwise>
138 <td width=
"10%" align=
"{$direction.align.end}">
139 <xsl:text> </xsl:text>
140 <xsl:if test=
"count($next)>0">
142 <xsl:attribute name=
"href">
143 <xsl:call-template name=
"href.target">
144 <xsl:with-param name=
"object" select=
"$next"/>
147 <xsl:attribute name=
"title">
148 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>
150 <xsl:call-template name=
"navig.content">
151 <xsl:with-param name=
"direction" select=
"'next'"/>
160 <xsl:if test=
"$header.rule != 0">
169 Customization of footer
170 - don't hide redundant Up link
171 - add tool tips to links
173 (overrides html/chunk-common.xsl)
175 <xsl:template name=
"footer.navigation">
176 <xsl:param name=
"prev" select=
"/foo"/>
177 <xsl:param name=
"next" select=
"/foo"/>
178 <xsl:param name=
"nav.context"/>
180 <xsl:variable name=
"home" select=
"/*[1]"/>
181 <xsl:variable name=
"up" select=
"parent::*"/>
183 <xsl:variable name=
"row1" select=
"count($prev) > 0
185 or count($next) > 0"/>
187 <xsl:variable name=
"row2" select=
"($prev and $navig.showtitles != 0)
188 or (generate-id($home) != generate-id(.)
189 or $nav.context = 'toc')
190 or ($chunk.tocs.and.lots != 0
191 and $nav.context != 'toc')
192 or ($next and $navig.showtitles != 0)"/>
194 <xsl:if test=
"$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
195 <div class=
"navfooter">
196 <xsl:if test=
"$footer.rule != 0">
200 <xsl:if test=
"$row1 or $row2">
201 <table width=
"100%" summary=
"Navigation footer">
202 <xsl:if test=
"$row1">
204 <td width=
"40%" align=
"{$direction.align.start}">
205 <xsl:if test=
"count($prev)>0">
207 <xsl:attribute name=
"href">
208 <xsl:call-template name=
"href.target">
209 <xsl:with-param name=
"object" select=
"$prev"/>
212 <xsl:attribute name=
"title">
213 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
215 <xsl:call-template name=
"navig.content">
216 <xsl:with-param name=
"direction" select=
"'prev'"/>
220 <xsl:text> </xsl:text>
222 <td width=
"20%" align=
"center">
224 <xsl:when test=
"count($up)>0">
226 <xsl:attribute name=
"href">
227 <xsl:call-template name=
"href.target">
228 <xsl:with-param name=
"object" select=
"$up"/>
231 <xsl:attribute name=
"title">
232 <xsl:apply-templates select=
"$up" mode=
"object.title.markup"/>
234 <xsl:call-template name=
"navig.content">
235 <xsl:with-param name=
"direction" select=
"'up'"/>
239 <xsl:otherwise> </xsl:otherwise>
242 <td width=
"40%" align=
"{$direction.align.end}">
243 <xsl:text> </xsl:text>
244 <xsl:if test=
"count($next)>0">
246 <xsl:attribute name=
"href">
247 <xsl:call-template name=
"href.target">
248 <xsl:with-param name=
"object" select=
"$next"/>
251 <xsl:attribute name=
"title">
252 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>
254 <xsl:call-template name=
"navig.content">
255 <xsl:with-param name=
"direction" select=
"'next'"/>
263 <xsl:if test=
"$row2">
265 <td width=
"40%" align=
"{$direction.align.start}" valign=
"top">
266 <xsl:if test=
"$navig.showtitles != 0">
267 <xsl:apply-templates select=
"$prev" mode=
"object.title.markup"/>
269 <xsl:text> </xsl:text>
271 <td width=
"20%" align=
"center">
273 <xsl:when test=
"$home != . or $nav.context = 'toc'">
275 <xsl:attribute name=
"href">
276 <xsl:call-template name=
"href.target">
277 <xsl:with-param name=
"object" select=
"$home"/>
280 <xsl:attribute name=
"title">
281 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
283 <xsl:call-template name=
"navig.content">
284 <xsl:with-param name=
"direction" select=
"'home'"/>
287 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
288 <xsl:text> |
 </xsl:text>
291 <xsl:otherwise> </xsl:otherwise>
294 <xsl:if test=
"$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
296 <xsl:attribute name=
"href">
297 <xsl:value-of select=
"$chunked.filename.prefix"/>
298 <xsl:apply-templates select=
"/*[1]"
299 mode=
"recursive-chunk-filename">
300 <xsl:with-param name=
"recursive" select=
"true()"/>
301 </xsl:apply-templates>
302 <xsl:text>-toc
</xsl:text>
303 <xsl:value-of select=
"$html.ext"/>
305 <xsl:call-template name=
"gentext">
306 <xsl:with-param name=
"key" select=
"'nav-toc'"/>
311 <td width=
"40%" align=
"{$direction.align.end}" valign=
"top">
312 <xsl:text> </xsl:text>
313 <xsl:if test=
"$navig.showtitles != 0">
314 <xsl:apply-templates select=
"$next" mode=
"object.title.markup"/>