blob: 66537c0e1eeb3349e0595c59ece20b1f516a50c7 [file] [log] [blame]
njn3e986b22004-11-30 10:43:45 +00001<?xml version="1.0"?> <!-- -*- sgml -*- -->
2<xsl:stylesheet
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4
5<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
6<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
7<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/manifest.xsl"/>
8<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-code.xsl"/>
9<xsl:import href="vg-common.xsl"/>
10
11<!-- use 8859-1 encoding -->
12<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
13
14<xsl:param name="use.id.as.filename" select="'1'"/>
15<xsl:param name="chunker.output.indent" select="'yes'"/>
16<!-- use our custom html stylesheet -->
17<xsl:param name="html.stylesheet" select="'vg_basic.css'"/>
18
19<!-- use our custom header -->
20<xsl:template name="header.navigation">
21 <xsl:param name="prev" select="/foo"/>
22 <xsl:param name="next" select="/foo"/>
23 <xsl:param name="nav.context"/>
24
25 <xsl:variable name="home" select="/*[1]"/>
26 <xsl:variable name="up" select="parent::*"/>
27
28 <xsl:variable name="row1" select="$navig.showtitles != 0"/>
29 <xsl:variable name="row2" select="count($prev) &gt; 0
30 or (count($up) &gt; 0
31 and generate-id($up) != generate-id($home) )
32 or count($next) &gt; 0"/>
33
34<div>
35<!-- never show header nav stuff on title page -->
36<xsl:if test="count($prev)>0">
37 <xsl:if test="$row1 or $row2">
38 <table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header">
39 <xsl:if test="$row2">
40 <tr>
41 <!-- prev -->
42 <td width="22px" align="center" valign="middle">
43 <xsl:if test="count($prev)>0">
44 <a accesskey="p">
45 <xsl:attribute name="href">
46 <xsl:call-template name="href.target">
47 <xsl:with-param name="object" select="$prev"/>
48 </xsl:call-template>
49 </xsl:attribute>
50 <img src="images/prev.png" width="18" height="21" border="0">
51 <xsl:attribute name="alt">
52 <xsl:call-template name="gentext">
53 <xsl:with-param name="key">nav-prev</xsl:with-param>
54 </xsl:call-template>
55 </xsl:attribute>
56 </img>
57 </a>
58 </xsl:if>
59 </td>
60 <!-- up -->
61 <xsl:if test="count($up)>0">
62 <td width="25px" align="center" valign="middle">
63 <a accesskey="u">
64 <xsl:attribute name="href">
65 <xsl:call-template name="href.target">
66 <xsl:with-param name="object" select="$up"/>
67 </xsl:call-template>
68 </xsl:attribute>
69 <img src="images/up.png" width="21" height="18" border="0">
70 <xsl:attribute name="alt">
71 <xsl:call-template name="gentext">
72 <xsl:with-param name="key">nav-up</xsl:with-param>
73 </xsl:call-template>
74 </xsl:attribute>
75 </img>
76 </a>
77 </td>
78 </xsl:if>
79 <!-- home -->
80 <xsl:if test="$home != . or $nav.context = 'toc'">
81 <td width="31px" align="center" valign="middle">
82 <a accesskey="h">
83 <xsl:attribute name="href">
84 <xsl:call-template name="href.target">
85 <xsl:with-param name="object" select="$home"/>
86 </xsl:call-template>
87 </xsl:attribute>
88 <img src="images/home.png" width="27" height="20" border="0">
89 <xsl:attribute name="alt">
90 <xsl:call-template name="gentext">
91 <xsl:with-param name="key">nav-up</xsl:with-param>
92 </xsl:call-template>
93 </xsl:attribute>
94 </img>
95 </a>
96 </td>
97 </xsl:if>
98 <!-- chapter|section heading -->
99 <th align="center" valign="middle">
100 <xsl:apply-templates select="$up" mode="object.title.markup"/>
101<!--
102 <xsl:choose>
103 <xsl:when test="count($up) > 0 and generate-id($up) != generate-id($home)">
104 <xsl:apply-templates select="$up" mode="object.title.markup"/>
105 </xsl:when>
106 <xsl:otherwise>
107 <xsl:text>Valgrind User's Manual</xsl:text>
108 </xsl:otherwise>
109 </xsl:choose>
110-->
111 </th>
112 <!-- next -->
113 <td width="22px" align="center" valign="middle">
114 <xsl:if test="count($next)>0">
115 <a accesskey="n">
116 <xsl:attribute name="href">
117 <xsl:call-template name="href.target">
118 <xsl:with-param name="object" select="$next"/>
119 </xsl:call-template>
120 </xsl:attribute>
121 <img src="images/next.png" width="18" height="21" border="0">
122 <xsl:attribute name="alt">
123 <xsl:call-template name="gentext">
124 <xsl:with-param name="key">nav-next</xsl:with-param>
125 </xsl:call-template>
126 </xsl:attribute>
127 </img>
128 </a>
129 </xsl:if>
130 </td>
131 </tr>
132 </xsl:if>
133 </table>
134 </xsl:if>
135</xsl:if>
136</div>
137</xsl:template>
138
139
140<!-- our custom footer -->
141<xsl:template name="footer.navigation">
142 <xsl:param name="prev" select="/foo"/>
143 <xsl:param name="next" select="/foo"/>
144 <xsl:param name="nav.context"/>
145
146 <xsl:variable name="home" select="/*[1]"/>
147 <xsl:variable name="up" select="parent::*"/>
148
149 <xsl:variable name="row1" select="count($prev) &gt; 0
150 or count($up) &gt; 0
151 or count($next) &gt; 0"/>
152
153 <xsl:variable name="row2" select="($prev != 0)
154 or (generate-id($home) != generate-id(.)
155 or $nav.context = 'toc')
156 or ($chunk.tocs.and.lots != 0
157 and $nav.context != 'toc')
158 or ($next != 0)"/>
159 <div>
160 <xsl:if test="$row1 or $row2">
161 <br />
162 <table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
163 <xsl:if test="$row1">
164 <tr>
165 <td rowspan="2" width="40%" align="left">
166 <xsl:if test="count($prev)>0">
167 <a accesskey="p">
168 <xsl:attribute name="href">
169 <xsl:call-template name="href.target">
170 <xsl:with-param name="object" select="$prev"/>
171 </xsl:call-template>
172 </xsl:attribute>
173 <xsl:text>&#060;&#060;&#160;</xsl:text>
174 <xsl:apply-templates select="$prev" mode="object.title.markup"/>
175 </a>
176 </xsl:if>
177 <xsl:text>&#160;</xsl:text>
178 </td>
179 <td width="20%" align="center">
180 <xsl:choose>
181 <xsl:when test="count($up)>0">
182 <a accesskey="u">
183 <xsl:attribute name="href">
184 <xsl:call-template name="href.target">
185 <xsl:with-param name="object" select="$up"/>
186 </xsl:call-template>
187 </xsl:attribute>
188 <xsl:call-template name="navig.content">
189 <xsl:with-param name="direction" select="'up'"/>
190 </xsl:call-template>
191 </a>
192 </xsl:when>
193 <xsl:otherwise>&#160;</xsl:otherwise>
194 </xsl:choose>
195 </td>
196 <td rowspan="2" width="40%" align="right">
197 <xsl:text>&#160;</xsl:text>
198 <xsl:if test="count($next)>0">
199 <a accesskey="n">
200 <xsl:attribute name="href">
201 <xsl:call-template name="href.target">
202 <xsl:with-param name="object" select="$next"/>
203 </xsl:call-template>
204 </xsl:attribute>
205 <xsl:apply-templates select="$next" mode="object.title.markup"/>
206 <xsl:text>&#160;&#062;&#062;</xsl:text>
207 </a>
208 </xsl:if>
209 </td>
210 </tr>
211 </xsl:if>
212
213 <xsl:if test="$row2">
214 <tr>
215 <td width="20%" align="center">
216 <xsl:choose>
217 <xsl:when test="$home != . or $nav.context = 'toc'">
218 <a accesskey="h">
219 <xsl:attribute name="href">
220 <xsl:call-template name="href.target">
221 <xsl:with-param name="object" select="$home"/>
222 </xsl:call-template>
223 </xsl:attribute>
224 <xsl:call-template name="navig.content">
225 <xsl:with-param name="direction" select="'home'"/>
226 </xsl:call-template>
227 </a>
228 <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
229 <xsl:text>&#160;|&#160;</xsl:text>
230 </xsl:if>
231 </xsl:when>
232 <xsl:otherwise>&#160;</xsl:otherwise>
233 </xsl:choose>
234 <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
235 <a accesskey="t">
236 <xsl:attribute name="href">
237 <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename"/>
238 <xsl:text>-toc</xsl:text>
239 <xsl:value-of select="$html.ext"/>
240 </xsl:attribute>
241 <xsl:call-template name="gentext">
242 <xsl:with-param name="key" select="'nav-toc'"/>
243 </xsl:call-template>
244 </a>
245 </xsl:if>
246 </td>
247 </tr>
248 </xsl:if>
249 </table>
250 </xsl:if>
251 </div>
252</xsl:template>
253
254<!-- We don't like tables with borders -->
255<xsl:template match="revhistory" mode="titlepage.mode">
256 <xsl:variable name="numcols">
257 <xsl:choose>
258 <xsl:when test="//authorinitials">3</xsl:when>
259 <xsl:otherwise>2</xsl:otherwise>
260 </xsl:choose>
261 </xsl:variable>
262 <table width="100%" border="0" summary="Revision history">
263 <tr>
264 <th align="left" colspan="{$numcols}">
265 <h3>Revision History</h3>
266 </th>
267 </tr>
268 <xsl:apply-templates mode="titlepage.mode">
269 <xsl:with-param name="numcols" select="$numcols"/>
270 </xsl:apply-templates>
271 </table>
272</xsl:template>
273
274<!-- don't put an expanded set-level TOC, only book titles -->
275<xsl:template match="book" mode="toc">
276 <xsl:param name="toc-context" select="."/>
277 <xsl:choose>
278 <xsl:when test="local-name($toc-context) = 'set'">
279 <xsl:call-template name="subtoc">
280 <xsl:with-param name="toc-context" select="$toc-context"/>
281 <xsl:with-param name="nodes" select="foo"/>
282 </xsl:call-template>
283 </xsl:when>
284 <xsl:otherwise>
285 <xsl:call-template name="subtoc">
286 <xsl:with-param name="toc-context" select="$toc-context"/>
287 <xsl:with-param name="nodes" select="part|reference
288 |preface|chapter|appendix
289 |article
290 |bibliography|glossary|index
291 |refentry
292 |bridgehead[$bridgehead.in.toc !=
2930]"/>
294 </xsl:call-template>
295 </xsl:otherwise>
296 </xsl:choose>
297</xsl:template>
298
299<!-- question and answer set mods -->
300<xsl:template match="answer">
301 <xsl:variable name="deflabel">
302 <xsl:choose>
303 <xsl:when test="ancestor-or-self::*[@defaultlabel]">
304 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
305 /@defaultlabel"/>
306 </xsl:when>
307 <xsl:otherwise>
308 <xsl:value-of select="$qanda.defaultlabel"/>
309 </xsl:otherwise>
310 </xsl:choose>
311 </xsl:variable>
312 <tr class="{name(.)}">
313 <td><xsl:text>&#160;</xsl:text></td>
314 <td align="left" valign="top">
315 <xsl:apply-templates select="*[name(.) != 'label']"/>
316 </td>
317 </tr>
318 <tr><td colspan="2"><xsl:text>&#160;</xsl:text></td></tr>
319</xsl:template>
320
321</xsl:stylesheet>