source: stylesheets/xhtml/lfs-navigational.xsl@ bf8c11f

Last change on this file since bf8c11f was bf8c11f, checked in by Jim Gifford <clfs@…>, 19 years ago

r627@server (orig r625): jim | 2005-10-31 12:59:34 -0800
Import of Cross-LFS Book

  • Property mode set to 100644
File size: 14.9 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <!-- Dropping the HEAD links -->
8 <xsl:template name="html.head">
9 <head>
10 <xsl:call-template name="system.head.content"/>
11 <xsl:call-template name="head.content"/>
12 <xsl:call-template name="user.head.content"/>
13 </head>
14 </xsl:template>
15
16 <!-- Header Navigation-->
17 <xsl:template name="header.navigation">
18 <xsl:param name="prev" select="/foo"/>
19 <xsl:param name="next" select="/foo"/>
20 <xsl:param name="nav.context"/>
21 <xsl:variable name="home" select="/*[1]"/>
22 <xsl:variable name="up" select="parent::*"/>
23 <xsl:variable name="row" select="count($prev) &gt; 0 or (count($up) &gt; 0
24 and generate-id($up) != generate-id($home)) or count($next) &gt; 0"/>
25 <!--Header titles-->
26 <xsl:if test="$row and $home != .">
27 <div class="navheader">
28 <xsl:if test="$home != .">
29 <div class="headertitles">
30 <h4>
31 <xsl:apply-templates select="$home" mode="object.title.markup"/>
32 <xsl:text> - </xsl:text>
33 <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
34 </h4>
35 <xsl:if test="$up != $home">
36 <h3>
37 <xsl:apply-templates select="$up" mode="object.title.markup"/>
38 </h3>
39 </xsl:if>
40 </div>
41 </xsl:if>
42 <ul class="headerlinks">
43 <!--Prev-->
44 <xsl:if test="count($prev)&gt;0 and $prev != $home">
45 <li class="prev">
46 <xsl:choose>
47 <xsl:when test="$prev[@id='ch-chroot-devices']
48 or $prev[@id='ch-reboot-whatnext']">
49 <a accesskey="p">
50 <xsl:attribute name="href">
51 <xsl:call-template name="href.target">
52 <xsl:with-param name="object"
53 select="//sect1[@id='ch-temp-system-choose']"/>
54 </xsl:call-template>
55 </xsl:attribute>
56 <xsl:attribute name="title">
57 <xsl:value-of select="//sect1[@id='ch-temp-system-choose']/title"/>
58 </xsl:attribute>
59 <xsl:call-template name="navig.content">
60 <xsl:with-param name="direction" select="'prev'"/>
61 </xsl:call-template>
62 </a>
63 <p>
64 <xsl:value-of select="//sect1[@id='ch-temp-system-choose']/title"/>
65 </p>
66 </xsl:when>
67 <xsl:otherwise>
68 <a accesskey="p">
69 <xsl:attribute name="href">
70 <xsl:call-template name="href.target">
71 <xsl:with-param name="object" select="$prev"/>
72 </xsl:call-template>
73 </xsl:attribute>
74 <xsl:attribute name="title">
75 <xsl:value-of select="$prev/title"/>
76 </xsl:attribute>
77 <xsl:call-template name="navig.content">
78 <xsl:with-param name="direction" select="'prev'"/>
79 </xsl:call-template>
80 </a>
81 <p>
82 <xsl:value-of select="$prev/title"/>
83 </p>
84 </xsl:otherwise>
85 </xsl:choose>
86 </li>
87 </xsl:if>
88 <!--Next-->
89 <xsl:if test="count($next)&gt;0 and @id!='ch-temp-system-choose'">
90 <li class="next">
91 <xsl:choose>
92 <xsl:when test="$next[@id='chapter-chroot'] or
93 $next[@id='chapter-reboot']">
94 <a accesskey="n">
95 <xsl:attribute name="href">
96 <xsl:call-template name="href.target">
97 <xsl:with-param name="object"
98 select="//part[@id='part5']"/>
99 </xsl:call-template>
100 </xsl:attribute>
101 <xsl:attribute name="title">
102 <xsl:value-of select="//part[@id='part5']/title"/>
103 </xsl:attribute>
104 <xsl:call-template name="navig.content">
105 <xsl:with-param name="direction" select="'next'"/>
106 </xsl:call-template>
107 </a>
108 <p>
109 <xsl:value-of select="//part[@id='part5']/title"/>
110 </p>
111 </xsl:when>
112 <xsl:otherwise>
113 <a accesskey="n">
114 <xsl:attribute name="href">
115 <xsl:call-template name="href.target">
116 <xsl:with-param name="object" select="$next"/>
117 </xsl:call-template>
118 </xsl:attribute>
119 <xsl:attribute name="title">
120 <xsl:choose>
121 <xsl:when test="local-name($next)='index'">
122 <xsl:call-template name="gentext">
123 <xsl:with-param name="key">Index</xsl:with-param>
124 </xsl:call-template>
125 </xsl:when>
126 <xsl:otherwise>
127 <xsl:value-of select="$next/title"/>
128 </xsl:otherwise>
129 </xsl:choose>
130 </xsl:attribute>
131 <xsl:call-template name="navig.content">
132 <xsl:with-param name="direction" select="'next'"/>
133 </xsl:call-template>
134 </a>
135 <p>
136 <xsl:choose>
137 <xsl:when test="local-name($next)='index'">
138 <xsl:call-template name="gentext">
139 <xsl:with-param name="key">Index</xsl:with-param>
140 </xsl:call-template>
141 </xsl:when>
142 <xsl:otherwise>
143 <xsl:value-of select="$next/title"/>
144 </xsl:otherwise>
145 </xsl:choose>
146 </p>
147 </xsl:otherwise>
148 </xsl:choose>
149 </li>
150 </xsl:if>
151 <!--Up-->
152 <li class="up">
153 <xsl:if test="count($up)&gt;0 and $up != $home">
154 <a accesskey="u">
155 <xsl:attribute name="href">
156 <xsl:call-template name="href.target">
157 <xsl:with-param name="object" select="$up"/>
158 </xsl:call-template>
159 </xsl:attribute>
160 <xsl:attribute name="title">
161 <xsl:apply-templates select="$up" mode="object.title.markup"/>
162 </xsl:attribute>
163 <xsl:call-template name="navig.content">
164 <xsl:with-param name="direction" select="'up'"/>
165 </xsl:call-template>
166 </a>
167 </xsl:if>
168 <xsl:text>.</xsl:text>
169 </li>
170 <!--Home-->
171 <li class="home">
172 <a accesskey="h">
173 <xsl:attribute name="href">
174 <xsl:call-template name="href.target">
175 <xsl:with-param name="object" select="$home"/>
176 </xsl:call-template>
177 </xsl:attribute>
178 <xsl:attribute name="title">
179 <xsl:value-of select="$home/bookinfo/title"/>
180 <xsl:text> - </xsl:text>
181 <xsl:value-of select="$home/bookinfo/subtitle"/>
182 </xsl:attribute>
183 <xsl:call-template name="navig.content">
184 <xsl:with-param name="direction" select="'home'"/>
185 </xsl:call-template>
186 </a>
187 </li>
188 </ul>
189 </div>
190 </xsl:if>
191 </xsl:template>
192
193 <!-- Footer Navigation-->
194 <xsl:template name="footer.navigation">
195 <xsl:param name="prev" select="/foo"/>
196 <xsl:param name="next" select="/foo"/>
197 <xsl:param name="nav.context"/>
198 <xsl:variable name="home" select="/*[1]"/>
199 <xsl:variable name="up" select="parent::*"/>
200 <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
201 or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
202 <xsl:if test="$row">
203 <div class="navfooter">
204 <ul>
205 <!--Prev-->
206 <xsl:if test="count($prev)&gt;0 and $prev != $home">
207 <li class="prev">
208 <xsl:choose>
209 <xsl:when test="$prev[@id='ch-chroot-devices']
210 or $prev[@id='ch-reboot-whatnext']">
211 <a accesskey="p">
212 <xsl:attribute name="href">
213 <xsl:call-template name="href.target">
214 <xsl:with-param name="object"
215 select="//sect1[@id='ch-temp-system-choose']"/>
216 </xsl:call-template>
217 </xsl:attribute>
218 <xsl:attribute name="title">
219 <xsl:value-of select="//sect1[@id='ch-temp-system-choose']/title"/>
220 </xsl:attribute>
221 <xsl:call-template name="navig.content">
222 <xsl:with-param name="direction" select="'prev'"/>
223 </xsl:call-template>
224 </a>
225 <p>
226 <xsl:value-of select="//sect1[@id='ch-temp-system-choose']/title"/>
227 </p>
228 </xsl:when>
229 <xsl:otherwise>
230 <a accesskey="p">
231 <xsl:attribute name="href">
232 <xsl:call-template name="href.target">
233 <xsl:with-param name="object" select="$prev"/>
234 </xsl:call-template>
235 </xsl:attribute>
236 <xsl:attribute name="title">
237 <xsl:value-of select="$prev/title"/>
238 </xsl:attribute>
239 <xsl:call-template name="navig.content">
240 <xsl:with-param name="direction" select="'prev'"/>
241 </xsl:call-template>
242 </a>
243 <p>
244 <xsl:value-of select="$prev/title"/>
245 </p>
246 </xsl:otherwise>
247 </xsl:choose>
248 </li>
249 </xsl:if>
250 <!--Next-->
251 <xsl:if test="(count($next)&gt;0 and @id!='ch-temp-system-choose')
252 or generate-id($home) = generate-id(.)">
253 <li class="next">
254 <xsl:choose>
255 <xsl:when test="$next[@id='chapter-chroot'] or
256 $next[@id='chapter-reboot']">
257 <a accesskey="n">
258 <xsl:attribute name="href">
259 <xsl:call-template name="href.target">
260 <xsl:with-param name="object"
261 select="//part[@id='part5']"/>
262 </xsl:call-template>
263 </xsl:attribute>
264 <xsl:attribute name="title">
265 <xsl:value-of select="//part[@id='part5']/title"/>
266 </xsl:attribute>
267 <xsl:call-template name="navig.content">
268 <xsl:with-param name="direction" select="'next'"/>
269 </xsl:call-template>
270 </a>
271 <p>
272 <xsl:value-of select="//part[@id='part5']/title"/>
273 </p>
274 </xsl:when>
275 <xsl:otherwise>
276 <a accesskey="n">
277 <xsl:attribute name="href">
278 <xsl:call-template name="href.target">
279 <xsl:with-param name="object" select="$next"/>
280 </xsl:call-template>
281 </xsl:attribute>
282 <xsl:attribute name="title">
283 <xsl:choose>
284 <xsl:when test="local-name($next)='index'">
285 <xsl:call-template name="gentext">
286 <xsl:with-param name="key">Index</xsl:with-param>
287 </xsl:call-template>
288 </xsl:when>
289 <xsl:otherwise>
290 <xsl:value-of select="$next/title"/>
291 </xsl:otherwise>
292 </xsl:choose>
293 </xsl:attribute>
294 <xsl:call-template name="navig.content">
295 <xsl:with-param name="direction" select="'next'"/>
296 </xsl:call-template>
297 </a>
298 <p>
299 <xsl:choose>
300 <xsl:when test="local-name($next)='index'">
301 <xsl:call-template name="gentext">
302 <xsl:with-param name="key">Index</xsl:with-param>
303 </xsl:call-template>
304 </xsl:when>
305 <xsl:otherwise>
306 <xsl:value-of select="$next/title"/>
307 </xsl:otherwise>
308 </xsl:choose>
309 </p>
310 </xsl:otherwise>
311 </xsl:choose>
312 </li>
313 </xsl:if>
314 <!--Up-->
315 <li class="up">
316 <xsl:if test="count($up)&gt;0 and $up != $home">
317 <a accesskey="u">
318 <xsl:attribute name="href">
319 <xsl:call-template name="href.target">
320 <xsl:with-param name="object" select="$up"/>
321 </xsl:call-template>
322 </xsl:attribute>
323 <xsl:attribute name="title">
324 <xsl:apply-templates select="$up" mode="object.title.markup"/>
325 </xsl:attribute>
326 <xsl:call-template name="navig.content">
327 <xsl:with-param name="direction" select="'up'"/>
328 </xsl:call-template>
329 </a>
330 </xsl:if>
331 <xsl:text>.</xsl:text>
332 </li>
333 <!--Home-->
334 <li class="home">
335 <xsl:if test="$home != .">
336 <a accesskey="h">
337 <xsl:attribute name="href">
338 <xsl:call-template name="href.target">
339 <xsl:with-param name="object" select="$home"/>
340 </xsl:call-template>
341 </xsl:attribute>
342 <xsl:attribute name="title">
343 <xsl:value-of select="$home/bookinfo/title"/>
344 <xsl:text> - </xsl:text>
345 <xsl:value-of select="$home/bookinfo/subtitle"/>
346 </xsl:attribute>
347 <xsl:call-template name="navig.content">
348 <xsl:with-param name="direction" select="'home'"/>
349 </xsl:call-template>
350 </a>
351 </xsl:if>
352 <xsl:text>.</xsl:text>
353 </li>
354 </ul>
355 </div>
356 </xsl:if>
357 </xsl:template>
358
359</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.