source: stylesheets/xhtml/lfs-navigational.xsl@ 37eabe3

Last change on this file since 37eabe3 was 1bec700, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Internationalization support into the stylesheets, first phase.

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

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