source: stylesheets/xhtml/lfs-navigational.xsl@ 9e2b55c

6.0
Last change on this file since 9e2b55c was 9e2b55c, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Fixed a small issue about the Index and navigational links for HTML output.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4151 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 9.5 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 <xsl:if test="$row and $home != .">
26 <div class="navheader">
27 <xsl:if test="$home != .">
28 <div class="headertitles">
29 <h4>
30 <xsl:apply-templates select="$home" mode="object.title.markup"/>
31 <xsl:text> - </xsl:text>
32 <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
33 </h4>
34 <xsl:if test="$up != $home">
35 <h3>
36 <xsl:apply-templates select="$up" mode="object.title.markup"/>
37 </h3>
38 </xsl:if>
39 </div>
40 </xsl:if>
41 <ul class="headerlinks">
42 <xsl:if test="count($prev)&gt;0 and $prev != $home">
43 <li class="prev">
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 <xsl:attribute name="title">
51 <xsl:value-of select="$prev/title"/>
52 </xsl:attribute>
53 <xsl:call-template name="navig.content">
54 <xsl:with-param name="direction" select="'prev'"/>
55 </xsl:call-template>
56 </a>
57 <p>
58 <xsl:value-of select="$prev/title"/>
59 </p>
60 </li>
61 </xsl:if>
62 <xsl:if test="count($next)&gt;0">
63 <li class="next">
64 <a accesskey="n">
65 <xsl:attribute name="href">
66 <xsl:call-template name="href.target">
67 <xsl:with-param name="object" select="$next"/>
68 </xsl:call-template>
69 </xsl:attribute>
70 <xsl:attribute name="title">
71 <xsl:choose>
72 <xsl:when test="local-name($next)='index'">
73 <xsl:text>Index</xsl:text>
74 </xsl:when>
75 <xsl:otherwise>
76 <xsl:value-of select="$next/title"/>
77 </xsl:otherwise>
78 </xsl:choose>
79 </xsl:attribute>
80 <xsl:call-template name="navig.content">
81 <xsl:with-param name="direction" select="'next'"/>
82 </xsl:call-template>
83 </a>
84 <p>
85 <xsl:choose>
86 <xsl:when test="local-name($next)='index'">
87 <xsl:text>Index</xsl:text>
88 </xsl:when>
89 <xsl:otherwise>
90 <xsl:value-of select="$next/title"/>
91 </xsl:otherwise>
92 </xsl:choose>
93 </p>
94 </li>
95 </xsl:if>
96 <li class="up">
97 <xsl:if test="count($up)&gt;0 and $up != $home">
98 <a accesskey="u">
99 <xsl:attribute name="href">
100 <xsl:call-template name="href.target">
101 <xsl:with-param name="object" select="$up"/>
102 </xsl:call-template>
103 </xsl:attribute>
104 <xsl:attribute name="title">
105 <xsl:apply-templates select="$up" mode="object.title.markup"/>
106 </xsl:attribute>
107 <xsl:call-template name="navig.content">
108 <xsl:with-param name="direction" select="'up'"/>
109 </xsl:call-template>
110 </a>
111 </xsl:if>
112 <xsl:text>.</xsl:text>
113 </li>
114 <li class="home">
115 <a accesskey="h">
116 <xsl:attribute name="href">
117 <xsl:call-template name="href.target">
118 <xsl:with-param name="object" select="$home"/>
119 </xsl:call-template>
120 </xsl:attribute>
121 <xsl:attribute name="title">
122 <xsl:value-of select="$home/bookinfo/title"/>
123 <xsl:text> - </xsl:text>
124 <xsl:value-of select="$home/bookinfo/subtitle"/>
125 </xsl:attribute>
126 <xsl:call-template name="navig.content">
127 <xsl:with-param name="direction" select="'home'"/>
128 </xsl:call-template>
129 </a>
130 </li>
131 </ul>
132 </div>
133 </xsl:if>
134 </xsl:template>
135
136 <!-- Footer Navigation-->
137 <xsl:template name="footer.navigation">
138 <xsl:param name="prev" select="/foo"/>
139 <xsl:param name="next" select="/foo"/>
140 <xsl:param name="nav.context"/>
141 <xsl:variable name="home" select="/*[1]"/>
142 <xsl:variable name="up" select="parent::*"/>
143 <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
144 or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
145 <xsl:if test="$row">
146 <div class="navfooter">
147 <ul>
148 <xsl:if test="count($prev)&gt;0 and $prev != $home">
149 <li class="prev">
150 <a accesskey="p">
151 <xsl:attribute name="href">
152 <xsl:call-template name="href.target">
153 <xsl:with-param name="object" select="$prev"/>
154 </xsl:call-template>
155 </xsl:attribute>
156 <xsl:attribute name="title">
157 <xsl:value-of select="$prev/title"/>
158 </xsl:attribute>
159 <xsl:call-template name="navig.content">
160 <xsl:with-param name="direction" select="'prev'"/>
161 </xsl:call-template>
162 </a>
163 <p>
164 <xsl:value-of select="$prev/title"/>
165 </p>
166 </li>
167 </xsl:if>
168 <xsl:if test="count($next)&gt;0">
169 <li class="next">
170 <a accesskey="n">
171 <xsl:attribute name="href">
172 <xsl:call-template name="href.target">
173 <xsl:with-param name="object" select="$next"/>
174 </xsl:call-template>
175 </xsl:attribute>
176 <xsl:attribute name="title">
177 <xsl:choose>
178 <xsl:when test="local-name($next)='index'">
179 <xsl:text>Index</xsl:text>
180 </xsl:when>
181 <xsl:otherwise>
182 <xsl:value-of select="$next/title"/>
183 </xsl:otherwise>
184 </xsl:choose>
185 </xsl:attribute>
186 <xsl:call-template name="navig.content">
187 <xsl:with-param name="direction" select="'next'"/>
188 </xsl:call-template>
189 </a>
190 <p>
191 <xsl:choose>
192 <xsl:when test="local-name($next)='index'">
193 <xsl:text>Index</xsl:text>
194 </xsl:when>
195 <xsl:otherwise>
196 <xsl:value-of select="$next/title"/>
197 </xsl:otherwise>
198 </xsl:choose>
199 </p>
200 </li>
201 </xsl:if>
202 <li class="up">
203 <xsl:if test="count($up)&gt;0 and $up != $home">
204 <a accesskey="u">
205 <xsl:attribute name="href">
206 <xsl:call-template name="href.target">
207 <xsl:with-param name="object" select="$up"/>
208 </xsl:call-template>
209 </xsl:attribute>
210 <xsl:attribute name="title">
211 <xsl:apply-templates select="$up" mode="object.title.markup"/>
212 </xsl:attribute>
213 <xsl:call-template name="navig.content">
214 <xsl:with-param name="direction" select="'up'"/>
215 </xsl:call-template>
216 </a>
217 </xsl:if>
218 <xsl:text>.</xsl:text>
219 </li>
220 <li class="home">
221 <xsl:if test="$home != .">
222 <a accesskey="h">
223 <xsl:attribute name="href">
224 <xsl:call-template name="href.target">
225 <xsl:with-param name="object" select="$home"/>
226 </xsl:call-template>
227 </xsl:attribute>
228 <xsl:attribute name="title">
229 <xsl:value-of select="$home/bookinfo/title"/>
230 <xsl:text> - </xsl:text>
231 <xsl:value-of select="$home/bookinfo/subtitle"/>
232 </xsl:attribute>
233 <xsl:call-template name="navig.content">
234 <xsl:with-param name="direction" select="'home'"/>
235 </xsl:call-template>
236 </a>
237 </xsl:if>
238 <xsl:text>.</xsl:text>
239 </li>
240 </ul>
241 </div>
242 </xsl:if>
243 </xsl:template>
244
245</xsl:stylesheet>
246
247
Note: See TracBrowser for help on using the repository browser.