]> git.stg.codes - stg.git/blob - doc/xslt/slides/xhtml/w3c.xsl
Merge branch 'master' into full-month-stats
[stg.git] / doc / xslt / slides / xhtml / w3c.xsl
1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5
6 <xsl:import href="slides-common.xsl"/>
7
8 <xsl:param name="logo.image.uri" select="''"/>
9 <xsl:param name="logo.uri" select="''"/>
10 <xsl:param name="logo.title" select="''"/>
11
12 <xsl:param name="next.image" select="'active/w3c-next.png'"/>
13 <xsl:param name="no.next.image" select="'inactive/w3c-next.png'"/>
14
15 <xsl:param name="prev.image" select="'active/w3c-prev.png'"/>
16 <xsl:param name="no.prev.image" select="'inactive/w3c-prev.png'"/>
17
18 <xsl:param name="toc.image" select="'active/w3c-toc.png'"/>
19 <xsl:param name="no.toc.image" select="'inactive/w3c-toc.png'"/>
20
21 <xsl:param name="css.stylesheet" select="'slides-w3c.css'"/>
22
23 <xsl:template name="logo">
24   <xsl:if test="$logo.uri != ''">
25     <a href="{$logo.uri}" title="{$logo.title}">
26       <xsl:choose>
27         <xsl:when test="$logo.image.uri=''">
28           <xsl:value-of select="$logo.title"/>
29         </xsl:when>
30         <xsl:otherwise>
31           <img src="{$logo.image.uri}" alt="{$logo.title}" border="0"/>
32         </xsl:otherwise>
33       </xsl:choose>
34     </a>
35   </xsl:if>
36 </xsl:template>
37
38 <xsl:template name="overlayDiv.attributes">
39   <xsl:if test="$overlay != 0">
40     <xsl:attribute name="style">
41       <xsl:text>position: absolute; visibility: visible;</xsl:text>
42     </xsl:attribute>
43   </xsl:if>
44 </xsl:template>
45
46 <!-- ====================================================================== -->
47
48 <xsl:template name="top-nav">
49   <xsl:param name="home"/>
50   <xsl:param name="up"/>
51   <xsl:param name="next"/>
52   <xsl:param name="prev"/>
53   <xsl:param name="tocfile" select="$toc.html"/>
54
55   <div class="navhead">
56     <table class="navbar" cellspacing="0" cellpadding="0" border="0" width="97%" summary="Navigation buttons">
57       <tr>
58         <td align="left" valign="top">
59           <xsl:call-template name="logo"/>
60         </td>
61         <td valign="top" nowrap="nowrap" width="150">
62           <div align="right">
63             <xsl:choose>
64               <xsl:when test="$prev">
65                 <a rel="previous" accesskey="P">
66                   <xsl:attribute name="href">
67                     <xsl:apply-templates select="$prev" mode="filename"/>
68                   </xsl:attribute>
69                   <img border="0" width="32" height="32" alt=" Previous" title="{$prev/title}">
70                     <xsl:attribute name="src">
71                       <xsl:call-template name="prev.image"/>
72                     </xsl:attribute>
73                   </img>
74                 </a>
75               </xsl:when>
76               <xsl:otherwise>
77                 <img border="0" width="32" height="32" alt=" Previous" title="">
78                   <xsl:attribute name="src">
79                     <xsl:call-template name="no.prev.image"/>
80                   </xsl:attribute>
81                 </img>
82               </xsl:otherwise>
83             </xsl:choose>
84
85             <xsl:choose>
86               <xsl:when test="$tocfile != ''">
87                 <a rel="contents" href="{$tocfile}" accesskey="C">
88                   <img border="0" width="32" height="32" alt=" Contents" title="Table of Contents">
89                     <xsl:attribute name="src">
90                       <xsl:call-template name="toc.image"/>
91                     </xsl:attribute>
92                   </img>
93                 </a>
94               </xsl:when>
95               <xsl:otherwise>
96                 <img border="0" width="32" height="32" alt=" Contents" title="Table of Contents">
97                   <xsl:attribute name="src">
98                     <xsl:call-template name="no.toc.image"/>
99                   </xsl:attribute>
100                 </img>
101               </xsl:otherwise>
102             </xsl:choose>
103
104             <xsl:choose>
105               <xsl:when test="$next">
106                 <a rel="next" accesskey="N">
107                   <xsl:attribute name="href">
108                     <xsl:apply-templates select="$next" mode="filename"/>
109                   </xsl:attribute>
110                   <img border="0" width="32" height="32" alt=" Next" title="{$next/title}">
111                     <xsl:attribute name="src">
112                       <xsl:call-template name="next.image"/>
113                     </xsl:attribute>
114                   </img>
115                 </a>
116               </xsl:when>
117               <xsl:otherwise>
118                 <img border="0" width="32" height="32" alt=" Next" title="">
119                   <xsl:attribute name="src">
120                     <xsl:call-template name="no.next.image"/>
121                   </xsl:attribute>
122                 </img>
123               </xsl:otherwise>
124             </xsl:choose>
125           </div>
126         </td>
127       </tr>
128     </table>
129
130     <xsl:apply-templates select="title"/>
131     <hr class="top-nav-sep"/>
132   </div>
133 </xsl:template>
134
135 <xsl:template name="bottom-nav">
136   <xsl:param name="home"/>
137   <xsl:param name="up"/>
138   <xsl:param name="next"/>
139   <xsl:param name="prev"/>
140   <xsl:param name="tocfile" select="$toc.html"/>
141
142   <div class="navfoot">
143     <hr class="bottom-nav-sep"/>
144     <table class="footer" cellspacing="0" cellpadding="0" border="0" width="97%" summary="footer">
145       <tr>
146         <td align="left" valign="top">
147           <xsl:variable name="author" select="(/slides/slidesinfo//author                                               |/slides/slidesinfo//editor)"/>
148           <xsl:for-each select="$author">
149             <xsl:choose>
150               <xsl:when test=".//email">
151                 <a href="mailto:{.//email[1]}">
152                   <xsl:call-template name="person.name"/>
153                 </a>
154               </xsl:when>
155               <xsl:otherwise>
156                 <xsl:call-template name="person.name"/>
157               </xsl:otherwise>
158             </xsl:choose>
159
160             <xsl:if test="position() &lt; last()">, </xsl:if>
161           </xsl:for-each>
162         </td>
163         <td align="right" valign="top">
164           <span class="index">
165             <xsl:value-of select="count(preceding::foil)                                   + count(preceding::foilgroup)                                   + count(ancestor::foilgroup)                                   + 1"/>
166             <xsl:text> of </xsl:text>
167             <xsl:value-of select="count(//foil|//foilgroup)"/>
168           </span>
169         </td>
170
171         <td valign="top" nowrap="nowrap" width="150">
172           <div align="right">
173             <xsl:choose>
174               <xsl:when test="$prev">
175                 <a rel="previous" accesskey="P">
176                   <xsl:attribute name="href">
177                     <xsl:apply-templates select="$prev" mode="filename"/>
178                   </xsl:attribute>
179                   <img border="0" width="32" height="32" alt=" Previous" title="{$prev/title}">
180                     <xsl:attribute name="src">
181                       <xsl:call-template name="prev.image"/>
182                     </xsl:attribute>
183                   </img>
184                 </a>
185               </xsl:when>
186               <xsl:otherwise>
187                 <img border="0" width="32" height="32" alt=" Prev" title="">
188                 <xsl:attribute name="src">
189                     <xsl:call-template name="no.prev.image"/>
190                 </xsl:attribute>
191                 </img>
192               </xsl:otherwise>
193             </xsl:choose>
194
195             <xsl:choose>
196               <xsl:when test="$next">
197                 <a rel="next" accesskey="N">
198                   <xsl:attribute name="href">
199                     <xsl:apply-templates select="$next" mode="filename"/>
200                   </xsl:attribute>
201                   <img border="0" width="32" height="32" alt=" Next" title="{$next/title}">
202                     <xsl:attribute name="src">
203                       <xsl:call-template name="next.image"/>
204                     </xsl:attribute>
205                   </img>
206                 </a>
207               </xsl:when>
208               <xsl:otherwise>
209                 <img border="0" width="32" height="32" alt=" Next" title="">
210                   <xsl:attribute name="src">
211                     <xsl:call-template name="no.next.image"/>
212                   </xsl:attribute>
213                 </img>
214               </xsl:otherwise>
215             </xsl:choose>
216           </div>
217         </td>
218       </tr>
219     </table>
220   </div>
221 </xsl:template>
222
223 <!-- ====================================================================== -->
224
225 <xsl:template name="titlepage-top-nav">
226   <xsl:param name="home"/>
227   <xsl:param name="up"/>
228   <xsl:param name="next"/>
229   <xsl:param name="prev"/>
230   <xsl:param name="tocfile" select="$toc.html"/>
231
232   <div class="navhead">
233     <table class="navbar" cellspacing="0" cellpadding="0" border="0" width="97%" summary="Navigation buttons">
234       <tr>
235         <td align="left" valign="top">
236           <xsl:call-template name="logo"/>
237         </td>
238         <td valign="top" nowrap="nowrap" width="150">
239           <div align="right">
240             <xsl:choose>
241               <xsl:when test="$prev">
242                 <a rel="previous" accesskey="P">
243                   <xsl:attribute name="href">
244                     <xsl:apply-templates select="$prev" mode="filename"/>
245                   </xsl:attribute>
246                   <img border="0" width="32" height="32" alt=" Previous" title="{$prev/title}">
247                     <xsl:attribute name="src">
248                       <xsl:call-template name="prev.image"/>
249                     </xsl:attribute>
250                   </img>
251                 </a>
252               </xsl:when>
253               <xsl:otherwise>
254                 <img border="0" width="32" height="32" alt=" Previous" title="">
255                   <xsl:attribute name="src">
256                     <xsl:call-template name="no.prev.image"/>
257                   </xsl:attribute>
258                 </img>
259               </xsl:otherwise>
260             </xsl:choose>
261
262             <xsl:choose>
263               <xsl:when test="$tocfile != ''">
264                 <a rel="contents" href="{$tocfile}" accesskey="C">
265                   <img border="0" width="32" height="32" alt=" Contents" title="Table of Contents">
266                     <xsl:attribute name="src">
267                       <xsl:call-template name="toc.image"/>
268                     </xsl:attribute>
269                   </img>
270                 </a>
271               </xsl:when>
272               <xsl:otherwise>
273                 <img border="0" width="32" height="32" alt=" Contents" title="Table of Contents">
274                   <xsl:attribute name="src">
275                     <xsl:call-template name="no.toc.image"/>
276                   </xsl:attribute>
277                 </img>
278               </xsl:otherwise>
279             </xsl:choose>
280
281             <xsl:choose>
282               <xsl:when test="$next">
283                 <a rel="next" accesskey="N">
284                   <xsl:attribute name="href">
285                     <xsl:apply-templates select="$next" mode="filename"/>
286                   </xsl:attribute>
287                   <img border="0" width="32" height="32" alt=" Next" title="{$next/title}">
288                     <xsl:attribute name="src">
289                       <xsl:call-template name="next.image"/>
290                     </xsl:attribute>
291                   </img>
292                 </a>
293               </xsl:when>
294               <xsl:otherwise>
295                 <img border="0" width="32" height="32" alt=" Next" title="">
296                   <xsl:attribute name="src">
297                     <xsl:call-template name="no.next.image"/>
298                   </xsl:attribute>
299                 </img>
300               </xsl:otherwise>
301             </xsl:choose>
302           </div>
303         </td>
304       </tr>
305     </table>
306
307     <hr class="top-nav-sep"/>
308   </div>
309 </xsl:template>
310
311 <!-- ====================================================================== -->
312
313 <xsl:template name="foil-body">
314   <xsl:param name="home"/>
315   <xsl:param name="up"/>
316   <xsl:param name="next"/>
317   <xsl:param name="prev"/>
318   <xsl:param name="tocfile" select="$toc.html"/>
319
320   <!-- skip the title -->
321   <xsl:apply-templates select="*[name(.) != 'title']"/>
322 </xsl:template>
323
324 <xsl:template name="foilgroup-body">
325   <xsl:param name="home"/>
326   <xsl:param name="up"/>
327   <xsl:param name="next"/>
328   <xsl:param name="prev"/>
329   <xsl:param name="tocfile" select="$toc.html"/>
330
331   <!-- skip the title -->
332   <xsl:apply-templates select="*[name(.) != 'title'                                 and name(.) != 'foil'                                 and name(.) != 'foilgroup']"/>
333
334   <xsl:if test="$foilgroup.toc != 0">
335     <dl class="toc">
336       <xsl:apply-templates select="foil" mode="toc"/>
337     </dl>
338   </xsl:if>
339 </xsl:template>
340
341 <!-- ====================================================================== -->
342
343 <xsl:template match="@*" mode="copy">
344   <xsl:attribute name="{local-name(.)}">
345     <xsl:value-of select="."/>
346   </xsl:attribute>
347 </xsl:template>
348
349 <xsl:template xmlns:html="http://www.w3.org/1999/xhtml" match="html:*">
350   <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
351     <xsl:apply-templates select="@*" mode="copy"/>
352     <xsl:apply-templates/>
353   </xsl:element>
354 </xsl:template>
355
356 <!-- ====================================================================== -->
357
358 </xsl:stylesheet>