]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/slides/xhtml/slides-common.xsl
Add stylesheets for our evergreen docbook site.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / slides / xhtml / slides-common.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="../../xhtml/chunk.xsl"/>
7 <xsl:include href="../../VERSION"/>
8
9 <xsl:include href="param.xsl"/>
10 <xsl:include href="jscript.xsl"/>
11 <xsl:include href="graphics.xsl"/>
12 <xsl:include href="css.xsl"/>
13
14 <xsl:output method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
15
16 <xsl:strip-space elements="slides foil foilgroup"/>
17
18 <!-- Process the slides -->
19
20 <xsl:template match="/">
21   <xsl:apply-templates/>
22 </xsl:template>
23
24 <xsl:template match="slides">
25   <xsl:apply-templates select="." mode="toc"/>
26   <xsl:apply-templates/>
27 </xsl:template>
28
29 <!-- ====================================================================== -->
30 <!-- Every slide has top and bottom navigation -->
31
32 <xsl:template name="top-nav">
33   <xsl:param name="home"/>
34   <xsl:param name="up"/>
35   <xsl:param name="next"/>
36   <xsl:param name="prev"/>
37   <xsl:param name="tocfile" select="$toc.html"/>
38
39   <div class="navhead">
40     <table border="0" width="100%" cellspacing="0" cellpadding="0" summary="Navigation table">
41       <tr>
42         <td align="left" valign="bottom">
43           <xsl:if test="$home">
44             <span class="slidestitle">
45               <a>
46                 <xsl:attribute name="href">
47                   <xsl:apply-templates select="$home" mode="filename"/>
48                 </xsl:attribute>
49                 <xsl:value-of select="($home/title|$home/slidesinfo/title)[1]"/>
50               </a>
51             </span>
52           </xsl:if>
53           <xsl:text>&#160;</xsl:text>
54         </td>
55
56         <td align="right" valign="bottom">
57           <xsl:choose>
58             <xsl:when test="$home">
59               <span class="link-text">
60                 <a>
61                   <xsl:attribute name="href">
62                     <xsl:apply-templates select="$home" mode="filename"/>
63                   </xsl:attribute>
64                   <img alt="{$text.home}" border="0">
65                     <xsl:attribute name="src">
66                       <xsl:call-template name="home.image"/>
67                     </xsl:attribute>
68                   </img>
69                 </a>
70               </span>
71             </xsl:when>
72             <xsl:otherwise>
73               <span class="no-link-text">
74                 <img alt="{$text.home}" border="0">
75                   <xsl:attribute name="src">
76                     <xsl:call-template name="no.home.image"/>
77                   </xsl:attribute>
78                 </img>
79               </span>
80             </xsl:otherwise>
81           </xsl:choose>
82           <xsl:text>&#160;</xsl:text>
83
84           <xsl:choose>
85             <xsl:when test="$tocfile">
86               <span class="link-text">
87                 <a>
88                   <xsl:attribute name="href">
89                     <xsl:value-of select="$tocfile"/>
90                   </xsl:attribute>
91                   <img alt="{$text.toc}" border="0">
92                     <xsl:attribute name="src">
93                       <xsl:call-template name="toc.image"/>
94                     </xsl:attribute>
95                   </img>
96                 </a>
97               </span>
98             </xsl:when>
99             <xsl:otherwise>
100               <span class="no-link-text">
101                 <img alt="{$text.toc}" border="0">
102                   <xsl:attribute name="src">
103                     <xsl:call-template name="no.toc.image"/>
104                   </xsl:attribute>
105                 </img>
106               </span>
107             </xsl:otherwise>
108           </xsl:choose>
109           <xsl:text>&#160;</xsl:text>
110
111           <xsl:choose>
112             <xsl:when test="$prev">
113               <span class="link-text">
114                 <a>
115                   <xsl:attribute name="href">
116                     <xsl:apply-templates select="$prev" mode="filename"/>
117                   </xsl:attribute>
118                   <img alt="{$text.prev}" border="0">
119                     <xsl:attribute name="src">
120                       <xsl:call-template name="prev.image"/>
121                     </xsl:attribute>
122                   </img>
123                 </a>
124               </span>
125             </xsl:when>
126             <xsl:otherwise>
127               <span class="no-link-text">
128                 <img alt="{$text.prev}" border="0">
129                   <xsl:attribute name="src">
130                     <xsl:call-template name="no.prev.image"/>
131                   </xsl:attribute>
132                 </img>
133               </span>
134             </xsl:otherwise>
135           </xsl:choose>
136           <xsl:text>&#160;</xsl:text>
137
138           <xsl:choose>
139             <xsl:when test="$up">
140               <span class="link-text">
141                 <a>
142                   <xsl:attribute name="href">
143                     <xsl:apply-templates select="$up" mode="filename"/>
144                   </xsl:attribute>
145                   <img alt="{$text.up}" border="0">
146                     <xsl:attribute name="src">
147                       <xsl:call-template name="up.image"/>
148                     </xsl:attribute>
149                   </img>
150                 </a>
151               </span>
152             </xsl:when>
153             <xsl:otherwise>
154               <span class="no-link-text">
155                 <img alt="{$text.up}" border="0">
156                   <xsl:attribute name="src">
157                     <xsl:call-template name="no.up.image"/>
158                   </xsl:attribute>
159                 </img>
160               </span>
161             </xsl:otherwise>
162           </xsl:choose>
163           <xsl:text>&#160;</xsl:text>
164
165           <xsl:choose>
166             <xsl:when test="$next">
167               <span class="link-text">
168                 <a>
169                   <xsl:attribute name="href">
170                     <xsl:apply-templates select="$next" mode="filename"/>
171                   </xsl:attribute>
172                   <img alt="{$text.next}" border="0">
173                     <xsl:attribute name="src">
174                       <xsl:call-template name="next.image"/>
175                     </xsl:attribute>
176                   </img>
177                 </a>
178               </span>
179             </xsl:when>
180             <xsl:otherwise>
181               <span class="no-link-text">
182                 <img alt="{$text.next}" border="0">
183                   <xsl:attribute name="src">
184                     <xsl:call-template name="no.next.image"/>
185                   </xsl:attribute>
186                 </img>
187               </span>
188             </xsl:otherwise>
189           </xsl:choose>
190           <xsl:text>&#160;</xsl:text>
191         </td>
192       </tr>
193     </table>
194     <hr class="top-nav-sep"/>
195   </div>
196 </xsl:template>
197
198 <xsl:template name="bottom-nav">
199   <xsl:param name="home"/>
200   <xsl:param name="up"/>
201   <xsl:param name="next"/>
202   <xsl:param name="prev"/>
203   <xsl:param name="tocfile" select="$toc.html"/>
204
205   <div class="navfoot">
206     <hr class="bottom-nav-sep"/>
207     <table border="0" width="100%" cellspacing="0" cellpadding="0" summary="Navigation table">
208       <tr>
209         <td align="left" valign="top">
210           <xsl:apply-templates select="/slides/slidesinfo/copyright" mode="slide.footer.mode"/>
211           <xsl:text>&#160;</xsl:text>
212         </td>
213
214         <td align="right" valign="top">
215           <xsl:choose>
216             <xsl:when test="$prev">
217               <span class="link-text">
218                 <a>
219                   <xsl:attribute name="href">
220                     <xsl:apply-templates select="$prev" mode="filename"/>
221                   </xsl:attribute>
222                   <img alt="{$text.prev}" border="0">
223                     <xsl:attribute name="src">
224                       <xsl:call-template name="prev.image"/>
225                     </xsl:attribute>
226                   </img>
227                 </a>
228               </span>
229             </xsl:when>
230             <xsl:otherwise>
231               <span class="no-link-text">
232                 <img alt="{$text.prev}" border="0">
233                   <xsl:attribute name="src">
234                     <xsl:call-template name="no.prev.image"/>
235                   </xsl:attribute>
236                 </img>
237               </span>
238             </xsl:otherwise>
239           </xsl:choose>
240           <xsl:text>&#160;</xsl:text>
241
242           <xsl:choose>
243             <xsl:when test="$next">
244               <span class="link-text">
245                 <a>
246                   <xsl:attribute name="href">
247                     <xsl:apply-templates select="$next" mode="filename"/>
248                   </xsl:attribute>
249                   <img alt="{$text.next}" border="0">
250                     <xsl:attribute name="src">
251                       <xsl:call-template name="next.image"/>
252                     </xsl:attribute>
253                   </img>
254                 </a>
255               </span>
256             </xsl:when>
257             <xsl:otherwise>
258               <span class="no-link-text">
259                 <img alt="{$text.next}" border="0">
260                   <xsl:attribute name="src">
261                     <xsl:call-template name="no.next.image"/>
262                   </xsl:attribute>
263                 </img>
264               </span>
265             </xsl:otherwise>
266           </xsl:choose>
267           <xsl:text>&#160;</xsl:text>
268         </td>
269       </tr>
270     </table>
271   </div>
272 </xsl:template>
273
274 <!-- Navigation is also provided in the form of links in the head -->
275
276 <xsl:template name="links">
277   <xsl:param name="home"/>
278   <xsl:param name="up"/>
279   <xsl:param name="next"/>
280   <xsl:param name="prev"/>
281   <xsl:param name="tocfile" select="$toc.html"/>
282
283   <xsl:if test="$tocfile != ''">
284     <link rel="contents" href="{$tocfile}">
285       <xsl:attribute name="title">
286         <xsl:value-of select="/slides/slidesinfo/title"/>
287       </xsl:attribute>
288     </link>
289   </xsl:if>
290
291   <xsl:if test="$home">
292     <link rel="top">
293       <xsl:attribute name="href">
294         <xsl:apply-templates select="$home" mode="filename"/>
295       </xsl:attribute>
296       <xsl:attribute name="title">
297         <xsl:value-of select="($home/title|$home/slidesinfo/title)[1]"/>
298       </xsl:attribute>
299     </link>
300
301     <link rel="first">
302       <xsl:attribute name="href">
303         <xsl:apply-templates select="$home" mode="filename"/>
304       </xsl:attribute>
305       <xsl:attribute name="title">
306         <xsl:value-of select="($home/title|$home/slidesinfo/title)[1]"/>
307       </xsl:attribute>
308     </link>
309   </xsl:if>
310
311   <xsl:if test="$up">
312     <link rel="up">
313       <xsl:attribute name="href">
314         <xsl:apply-templates select="$up" mode="filename"/>
315       </xsl:attribute>
316       <xsl:attribute name="title">
317         <xsl:value-of select="($up/title|$up/slidesinfo/title)[1]"/>
318       </xsl:attribute>
319     </link>
320   </xsl:if>
321
322   <xsl:if test="$prev">
323     <link rel="previous">
324       <xsl:attribute name="href">
325         <xsl:apply-templates select="$prev" mode="filename"/>
326       </xsl:attribute>
327       <xsl:attribute name="title">
328         <xsl:value-of select="($prev/title|$prev/slidesinfo/title)[1]"/>
329       </xsl:attribute>
330     </link>
331   </xsl:if>
332
333   <xsl:if test="$next">
334     <link rel="next">
335       <xsl:attribute name="href">
336         <xsl:apply-templates select="$next" mode="filename"/>
337       </xsl:attribute>
338       <xsl:attribute name="title">
339         <xsl:value-of select="$next/title"/>
340       </xsl:attribute>
341     </link>
342
343     <xsl:variable name="last" select="$next/following::foil[last()]"/>
344     <xsl:if test="$last">
345       <link rel="last">
346         <xsl:attribute name="href">
347           <xsl:apply-templates select="$last" mode="filename"/>
348         </xsl:attribute>
349         <xsl:attribute name="title">
350           <xsl:value-of select="$last/title"/>
351         </xsl:attribute>
352       </link>
353     </xsl:if>
354   </xsl:if>
355
356   <xsl:for-each select="foil">
357     <link rel="slides">
358       <xsl:attribute name="href">
359         <xsl:apply-templates select="." mode="filename"/>
360       </xsl:attribute>
361       <xsl:attribute name="title">
362         <xsl:value-of select="title[1]"/>
363       </xsl:attribute>
364     </link>
365   </xsl:for-each>
366
367   <xsl:for-each select="foilgroup|../foilgroup">
368     <link rel="section">
369       <xsl:attribute name="href">
370         <xsl:apply-templates select="." mode="filename"/>
371       </xsl:attribute>
372       <xsl:attribute name="title">
373         <xsl:value-of select="title[1]"/>
374       </xsl:attribute>
375     </link>
376   </xsl:for-each>
377 </xsl:template>
378
379 <!-- ====================================================================== -->
380 <!-- There are four kinds of slides: titlepage, toc, foil, and foilgroup -->
381 <!-- titlepage -->
382
383 <xsl:template match="slidesinfo">
384   <xsl:variable name="id">
385     <xsl:call-template name="object.id"/>
386   </xsl:variable>
387
388   <xsl:variable name="next" select="(/slides/foil|/slides/foilgroup)[1]"/>
389   <xsl:variable name="tocfile" select="$toc.html"/>
390   <xsl:variable name="dir">
391     <xsl:call-template name="dbhtml-dir"/>
392   </xsl:variable>
393
394
395   <xsl:call-template name="write.chunk">
396     <xsl:with-param name="indent" select="$output.indent"/>
397     <xsl:with-param name="filename" select="concat($base.dir, $dir, $titlefoil.html)"/>
398     <xsl:with-param name="content">
399       <html>
400         <head>
401           <title><xsl:value-of select="title"/></title>
402
403           <xsl:call-template name="system.head.content">
404             <xsl:with-param name="node" select=".."/>
405           </xsl:call-template>
406           
407           <meta name="generator" content="DocBook Slides Stylesheets V{$VERSION}"/>
408
409           <!-- Links -->
410           <xsl:if test="$css.stylesheet != ''">
411             <link type="text/css" rel="stylesheet">
412               <xsl:attribute name="href">
413                 <xsl:call-template name="css.stylesheet"/>
414               </xsl:attribute>
415             </link>
416           </xsl:if>
417           <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
418
419           <xsl:call-template name="links">
420             <xsl:with-param name="home" select="/slides"/>
421             <xsl:with-param name="next" select="$next"/>
422             <xsl:with-param name="tocfile" select="$tocfile"/>
423           </xsl:call-template>
424
425           <!-- Scripts -->
426
427           <xsl:if test="$overlay != 0 or $keyboard.nav != 0">
428             <script language="javascript" type="text/javascript">
429               <xsl:text> </xsl:text>
430             </script>
431           </xsl:if>
432
433           <xsl:if test="$keyboard.nav != 0">
434             <xsl:call-template name="ua.js"/>
435             <xsl:call-template name="xbDOM.js">
436               <xsl:with-param name="language" select="'javascript'"/>
437             </xsl:call-template>
438             <xsl:call-template name="xbLibrary.js"/>
439             <script language="javascript" type="text/javascript">
440               <xsl:text disable-output-escaping="yes">
441                 &lt;!--
442                 xblibrary = new xbLibrary('</xsl:text>
443               <xsl:call-template name="script-dir"/>
444               <xsl:text disable-output-escaping="yes">');
445                 // --&gt;
446               </xsl:text>
447             </script>
448             <xsl:call-template name="xbStyle.js"/>
449             <xsl:call-template name="xbCollapsibleLists.js"/>
450             <xsl:call-template name="slides.js">
451               <xsl:with-param name="language" select="'javascript'"/>
452             </xsl:call-template>
453           </xsl:if>
454
455           <xsl:if test="$overlay != '0'">
456             <xsl:call-template name="overlay.js">
457               <xsl:with-param name="language" select="'javascript'"/>
458             </xsl:call-template>
459           </xsl:if>
460
461           <xsl:call-template name="user.head.content">
462             <xsl:with-param name="node" select=".."/>
463           </xsl:call-template>
464         </head>
465         <body>
466           <xsl:attribute name="class">
467             <xsl:text>titlepage</xsl:text>
468             <xsl:if test="@role">
469               <xsl:text>-</xsl:text>
470               <xsl:value-of select="@role"/>
471             </xsl:if>
472           </xsl:attribute>
473
474           <xsl:call-template name="body.attributes"/>
475           <xsl:if test="$overlay != 0">
476             <xsl:attribute name="onload">
477               <xsl:text>overlaySetup('lc')</xsl:text>
478             </xsl:attribute>
479           </xsl:if>
480           <xsl:if test="$keyboard.nav != 0">
481             <xsl:attribute name="onkeypress">
482               <xsl:text>navigate(event)</xsl:text>
483             </xsl:attribute>
484           </xsl:if>
485
486           <div class="titlepage" id="{$id}">
487             <xsl:call-template name="titlepage-top-nav">
488               <xsl:with-param name="next" select="$next"/>
489               <xsl:with-param name="tocfile" select="$tocfile"/>
490             </xsl:call-template>
491
492             <div class="titlepage-body">
493               <xsl:call-template name="titlepage-body"/>
494             </div>
495
496             <div id="overlayDiv">
497               <xsl:call-template name="overlayDiv.attributes"/>
498               <xsl:call-template name="titlepage-bottom-nav">
499                 <xsl:with-param name="next" select="$next"/>
500                 <xsl:with-param name="tocfile" select="$tocfile"/>
501               </xsl:call-template>
502             </div>
503           </div>
504         </body>
505       </html>
506     </xsl:with-param>
507   </xsl:call-template>
508 </xsl:template>
509
510 <xsl:template name="titlepage-body">
511   <div class="{name(.)}">
512     <xsl:apply-templates mode="titlepage.mode"/>
513   </div>
514 </xsl:template>
515
516 <xsl:template name="titlepage-top-nav">
517   <xsl:param name="home"/>
518   <xsl:param name="up"/>
519   <xsl:param name="next"/>
520   <xsl:param name="prev"/>
521   <xsl:param name="tocfile" select="$toc.html"/>
522
523   <xsl:call-template name="top-nav">
524     <xsl:with-param name="home" select="$home"/>
525     <xsl:with-param name="up" select="$up"/>
526     <xsl:with-param name="next" select="$next"/>
527     <xsl:with-param name="prev" select="$prev"/>
528     <xsl:with-param name="tocfile" select="$tocfile"/>
529   </xsl:call-template>
530 </xsl:template>
531
532 <xsl:template name="titlepage-bottom-nav">
533   <xsl:param name="home"/>
534   <xsl:param name="up"/>
535   <xsl:param name="next"/>
536   <xsl:param name="prev"/>
537   <xsl:param name="tocfile" select="$toc.html"/>
538
539   <xsl:call-template name="bottom-nav">
540     <xsl:with-param name="home" select="$home"/>
541     <xsl:with-param name="up" select="$up"/>
542     <xsl:with-param name="next" select="$next"/>
543     <xsl:with-param name="prev" select="$prev"/>
544     <xsl:with-param name="tocfile" select="$tocfile"/>
545   </xsl:call-template>
546 </xsl:template>
547
548 <xsl:template match="slidesinfo/title">
549   <h1 class="{name(.)}"><xsl:apply-templates/></h1>
550 </xsl:template>
551
552 <xsl:template match="slidesinfo/authorgroup">
553   <xsl:apply-templates/>
554 </xsl:template>
555
556 <xsl:template match="slidesinfo/author|slidesinfo/authorgroup/author">
557   <h1 class="{name(.)}"><xsl:apply-imports/></h1>
558 </xsl:template>
559
560 <xsl:template match="slidesinfo/releaseinfo">
561   <h4 class="{name(.)}"><xsl:apply-templates/></h4>
562 </xsl:template>
563
564 <xsl:template match="slidesinfo/date">
565   <h4 class="{name(.)}"><xsl:apply-templates/></h4>
566 </xsl:template>
567
568 <xsl:template match="slidesinfo/copyright">
569   <!-- nop -->
570 </xsl:template>
571
572 <!-- On slides, output the credits explicitly each time -->
573 <xsl:template match="othercredit" mode="titlepage.mode">
574   <xsl:variable name="contrib" select="string(contrib)"/>
575   <xsl:choose>
576     <xsl:when test="contrib">
577       <xsl:call-template name="paragraph">
578         <xsl:with-param name="class" select="name(.)"/>
579         <xsl:with-param name="content">
580           <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
581           <xsl:text>: </xsl:text>
582           <xsl:call-template name="person.name"/>
583           <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
584         </xsl:with-param>
585       </xsl:call-template>
586     </xsl:when>
587     <xsl:otherwise>
588       <xsl:call-template name="paragraph">
589         <xsl:with-param name="class" select="name(.)"/>
590         <xsl:with-param name="content">
591           <xsl:call-template name="person.name"/>
592         </xsl:with-param>
593       </xsl:call-template>
594       <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
595     </xsl:otherwise>
596   </xsl:choose>
597 </xsl:template>
598
599 <!-- ====================================================================== -->
600 <!-- toc -->
601
602 <xsl:template match="slides" mode="toc">
603   <xsl:variable name="id">
604     <xsl:call-template name="object.id"/>
605   </xsl:variable>
606
607   <xsl:variable name="home" select="/slides"/>
608   <xsl:variable name="up" select="/slides"/>
609   <xsl:variable name="next" select="(foil|foilgroup)[1]"/>
610   <xsl:variable name="tocfile" select="''"/>
611   <xsl:variable name="dir"> <!-- MJ: added -->
612     <xsl:call-template name="dbhtml-dir"/>
613   </xsl:variable>
614
615   <xsl:call-template name="write.chunk">
616     <xsl:with-param name="indent" select="$output.indent"/>
617     <xsl:with-param name="filename" select="concat($base.dir, $dir, $toc.html)"/>
618     <xsl:with-param name="content">
619       <html>
620         <head>
621           <title><xsl:value-of select="slidesinfo/title"/></title>
622
623           <xsl:call-template name="system.head.content"/>
624
625           <meta name="generator" content="DocBook Slides Stylesheets V{$VERSION}"/>
626
627           <!-- Links -->
628           <xsl:if test="$css.stylesheet != ''">
629             <link type="text/css" rel="stylesheet">
630               <xsl:attribute name="href">
631                 <xsl:call-template name="css.stylesheet"/>
632               </xsl:attribute>
633             </link>
634           </xsl:if>
635           <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
636
637           <xsl:call-template name="links">
638             <xsl:with-param name="home" select="$home"/>
639             <xsl:with-param name="up" select="$up"/>
640             <xsl:with-param name="next" select="$next"/>
641             <xsl:with-param name="tocfile" select="$tocfile"/>
642           </xsl:call-template>
643
644           <!-- Scripts -->
645
646           <xsl:if test="$overlay != 0 or $keyboard.nav != 0">
647             <script language="javascript" type="text/javascript">
648               <xsl:text> </xsl:text>
649             </script>
650           </xsl:if>
651
652           <xsl:if test="$keyboard.nav != 0">
653             <xsl:call-template name="ua.js"/>
654             <xsl:call-template name="xbDOM.js">
655               <xsl:with-param name="language" select="'javascript'"/>
656             </xsl:call-template>
657             <xsl:call-template name="xbLibrary.js"/>
658             <script language="javascript" type="text/javascript">
659               <xsl:text disable-output-escaping="yes">
660                 &lt;!--
661                 xblibrary = new xbLibrary('</xsl:text>
662               <xsl:call-template name="script-dir"/>
663               <xsl:text disable-output-escaping="yes">');
664                 // --&gt;
665               </xsl:text>
666             </script>
667             <xsl:call-template name="xbStyle.js"/>
668             <xsl:call-template name="xbCollapsibleLists.js"/>
669             <xsl:call-template name="slides.js">
670               <xsl:with-param name="language" select="'javascript'"/>
671             </xsl:call-template>
672           </xsl:if>
673
674           <xsl:if test="$overlay != '0'">
675             <xsl:call-template name="overlay.js">
676               <xsl:with-param name="language" select="'javascript'"/>
677             </xsl:call-template>
678           </xsl:if>
679
680           <xsl:call-template name="user.head.content"/>
681         </head>
682
683         <body class="tocpage">
684           <xsl:call-template name="body.attributes"/>
685           <xsl:if test="$overlay != 0">
686             <xsl:attribute name="onload">
687               <xsl:text>overlaySetup('lc')</xsl:text>
688             </xsl:attribute>
689           </xsl:if>
690           <xsl:if test="$keyboard.nav != 0">
691             <xsl:attribute name="onkeypress">
692               <xsl:text>navigate(event)</xsl:text>
693             </xsl:attribute>
694           </xsl:if>
695
696           <div id="{$id}">
697             <xsl:call-template name="toc-top-nav">
698               <xsl:with-param name="home" select="$home"/>
699               <xsl:with-param name="up" select="$up"/>
700               <xsl:with-param name="next" select="$next"/>
701               <xsl:with-param name="tocfile" select="$tocfile"/>
702             </xsl:call-template>
703
704             <div class="toc-body">
705               <xsl:call-template name="toc-body"/>
706             </div>
707
708             <div id="overlayDiv">
709               <xsl:call-template name="overlayDiv.attributes"/>
710               <xsl:call-template name="toc-bottom-nav">
711                 <xsl:with-param name="home" select="$home"/>
712                 <xsl:with-param name="up" select="$up"/>
713                 <xsl:with-param name="next" select="$next"/>
714                 <xsl:with-param name="tocfile" select="$tocfile"/>
715               </xsl:call-template>
716             </div>
717           </div>
718         </body>
719       </html>
720     </xsl:with-param>
721   </xsl:call-template>
722 </xsl:template>
723
724 <xsl:template name="toc-body">
725   <h1 class="title">
726     <a href="{$titlefoil.html}">
727       <xsl:value-of select="/slides/slidesinfo/title"/>
728     </a>
729   </h1>
730
731   <p class="toctitle">
732     <b>
733       <xsl:call-template name="gentext">
734         <xsl:with-param name="key">TableofContents</xsl:with-param>
735       </xsl:call-template>
736     </b>
737   </p>
738   <dl class="toc">
739     <xsl:apply-templates select="foilgroup|foil" mode="toc"/>
740   </dl>
741 </xsl:template>
742
743 <xsl:template name="toc-top-nav">
744   <xsl:param name="home" select="/slides"/>
745   <xsl:param name="up"/>
746   <xsl:param name="prev"/>
747   <xsl:param name="next" select="(foil|foilgroup)[1]"/>
748   <xsl:param name="tocfile"/>
749
750   <xsl:call-template name="top-nav">
751     <xsl:with-param name="home" select="$home"/>
752     <xsl:with-param name="up" select="$up"/>
753     <xsl:with-param name="next" select="$next"/>
754     <xsl:with-param name="prev" select="$prev"/>
755     <xsl:with-param name="tocfile" select="$tocfile"/>
756   </xsl:call-template>
757 </xsl:template>
758
759 <xsl:template name="toc-bottom-nav">
760   <xsl:param name="home" select="/slides"/>
761   <xsl:param name="up"/>
762   <xsl:param name="prev"/>
763   <xsl:param name="next" select="(foil|foilgroup)[1]"/>
764   <xsl:param name="tocfile"/>
765
766   <xsl:call-template name="bottom-nav">
767     <xsl:with-param name="home" select="$home"/>
768     <xsl:with-param name="up" select="$up"/>
769     <xsl:with-param name="next" select="$next"/>
770     <xsl:with-param name="prev" select="$prev"/>
771     <xsl:with-param name="tocfile" select="$tocfile"/>
772   </xsl:call-template>
773 </xsl:template>
774
775 <xsl:template match="foilgroup" mode="toc">
776   <xsl:param name="recursive" select="1"/>
777
778   <dt>
779     <xsl:apply-templates select="." mode="number"/>
780     <xsl:text>. </xsl:text>
781     <a>
782       <xsl:attribute name="href">
783         <xsl:apply-templates select="." mode="filename"/>
784       </xsl:attribute>
785       <xsl:value-of select="title"/>
786     </a>
787   </dt>
788   <xsl:if test="$recursive != 0">
789     <dd>
790       <dl class="toc">
791         <xsl:apply-templates select="foil" mode="toc"/>
792       </dl>
793     </dd>
794   </xsl:if>
795 </xsl:template>
796
797 <xsl:template match="foil" mode="toc">
798   <dt>
799     <xsl:apply-templates select="." mode="number"/>
800     <xsl:text>. </xsl:text>
801     <a>
802       <xsl:attribute name="href">
803         <xsl:apply-templates select="." mode="filename"/>
804       </xsl:attribute>
805       <xsl:value-of select="title"/>
806     </a>
807   </dt>
808 </xsl:template>
809
810 <xsl:template match="title|titleabbrev" mode="toc">
811   <xsl:apply-templates mode="toc"/>
812 </xsl:template>
813
814 <xsl:template match="speakernotes" mode="toc">
815   <!-- nop -->
816 </xsl:template>
817
818 <!-- ====================================================================== -->
819 <!-- foil -->
820
821 <xsl:template match="foil">
822   <xsl:param name="thisfoil">
823     <xsl:apply-templates select="." mode="chunk-filename"/>
824   </xsl:param>
825
826   <xsl:variable name="id">
827     <xsl:call-template name="object.id"/>
828   </xsl:variable>
829
830   <xsl:variable name="home" select="/slides"/>
831   <xsl:variable name="up" select="(parent::slides|parent::foilgroup)[1]"/>
832   <xsl:variable name="next" select="(following::foil                                     |following::foilgroup)[1]"/>
833   <xsl:variable name="prev" select="(preceding-sibling::foil[1]                                     |parent::foilgroup[1]                                     |/slides)[last()]"/>
834
835   <xsl:call-template name="write.chunk">
836     <xsl:with-param name="indent" select="$output.indent"/>
837     <xsl:with-param name="filename" select="concat($base.dir, $thisfoil)"/>
838     <xsl:with-param name="content">
839       <html>
840         <head>
841           <title><xsl:value-of select="title"/></title>
842
843           <xsl:call-template name="system.head.content"/>
844
845           <meta name="generator" content="DocBook Slides Stylesheets V{$VERSION}"/>
846
847           <!-- Links -->
848           <xsl:if test="$css.stylesheet != ''">
849             <link type="text/css" rel="stylesheet">
850               <xsl:attribute name="href">
851                 <xsl:call-template name="css.stylesheet"/>
852               </xsl:attribute>
853             </link>
854           </xsl:if>
855           <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
856
857           <xsl:call-template name="links">
858             <xsl:with-param name="home" select="$home"/>
859             <xsl:with-param name="up" select="$up"/>
860             <xsl:with-param name="next" select="$next"/>
861             <xsl:with-param name="prev" select="$prev"/>
862           </xsl:call-template>
863
864           <!-- Scripts -->
865
866           <xsl:if test="$overlay != 0 or $keyboard.nav != 0">
867             <script language="javascript" type="text/javascript">
868               <xsl:text> </xsl:text>
869             </script>
870           </xsl:if>
871
872           <xsl:if test="$keyboard.nav != 0">
873             <xsl:call-template name="ua.js"/>
874             <xsl:call-template name="xbDOM.js">
875               <xsl:with-param name="language" select="'javascript'"/>
876             </xsl:call-template>
877             <xsl:call-template name="xbLibrary.js"/>
878             <script language="javascript" type="text/javascript">
879               <xsl:text disable-output-escaping="yes">
880                 &lt;!--
881                 xblibrary = new xbLibrary('</xsl:text>
882               <xsl:call-template name="script-dir"/>
883               <xsl:text disable-output-escaping="yes">');
884                 // --&gt;
885               </xsl:text>
886             </script>
887             <xsl:call-template name="xbStyle.js"/>
888             <xsl:call-template name="xbCollapsibleLists.js"/>
889             <xsl:call-template name="slides.js">
890               <xsl:with-param name="language" select="'javascript'"/>
891             </xsl:call-template>
892           </xsl:if>
893
894           <xsl:if test="$overlay != '0'">
895             <xsl:call-template name="overlay.js">
896               <xsl:with-param name="language" select="'javascript'"/>
897             </xsl:call-template>
898           </xsl:if>
899
900           <xsl:call-template name="user.head.content"/>
901         </head>
902         <body>
903           <xsl:attribute name="class">
904             <xsl:value-of select="local-name(.)"/>
905             <xsl:if test="@role">
906               <xsl:text>-</xsl:text>
907               <xsl:value-of select="@role"/>
908             </xsl:if>
909           </xsl:attribute>
910
911           <xsl:call-template name="body.attributes"/>
912           <xsl:if test="$overlay != 0">
913             <xsl:attribute name="onload">
914               <xsl:text>overlaySetup('lc')</xsl:text>
915             </xsl:attribute>
916           </xsl:if>
917           <xsl:if test="$keyboard.nav != 0">
918             <xsl:attribute name="onkeypress">
919               <xsl:text>navigate(event)</xsl:text>
920             </xsl:attribute>
921           </xsl:if>
922
923           <div class="{name(.)}" id="{$id}">
924             <xsl:call-template name="foil-top-nav">
925               <xsl:with-param name="home" select="$home"/>
926               <xsl:with-param name="up" select="$up"/>
927               <xsl:with-param name="next" select="$next"/>
928               <xsl:with-param name="prev" select="$prev"/>
929             </xsl:call-template>
930
931             <div class="foil-body">
932               <xsl:call-template name="foil-body">
933                 <xsl:with-param name="home" select="$home"/>
934                 <xsl:with-param name="up" select="$up"/>
935                 <xsl:with-param name="next" select="$next"/>
936                 <xsl:with-param name="prev" select="$prev"/>
937               </xsl:call-template>
938             </div>
939
940             <div id="overlayDiv">
941               <xsl:call-template name="overlayDiv.attributes"/>
942               <xsl:call-template name="foil-bottom-nav">
943                 <xsl:with-param name="home" select="$home"/>
944                 <xsl:with-param name="up" select="$up"/>
945                 <xsl:with-param name="next" select="$next"/>
946                 <xsl:with-param name="prev" select="$prev"/>
947               </xsl:call-template>
948             </div>
949           </div>
950
951           <xsl:call-template name="process.footnotes"/>
952         </body>
953       </html>
954     </xsl:with-param>
955   </xsl:call-template>
956 </xsl:template>
957
958 <xsl:template name="foil-body">
959   <xsl:param name="home"/>
960   <xsl:param name="up"/>
961   <xsl:param name="next"/>
962   <xsl:param name="prev"/>
963   <xsl:param name="tocfile" select="$toc.html"/>
964   <xsl:apply-templates/>
965 </xsl:template>
966
967 <xsl:template name="foil-top-nav">
968   <xsl:param name="home"/>
969   <xsl:param name="up"/>
970   <xsl:param name="next"/>
971   <xsl:param name="prev"/>
972   <xsl:param name="tocfile" select="$toc.html"/>
973
974   <xsl:call-template name="top-nav">
975     <xsl:with-param name="home" select="$home"/>
976     <xsl:with-param name="up" select="$up"/>
977     <xsl:with-param name="next" select="$next"/>
978     <xsl:with-param name="prev" select="$prev"/>
979   </xsl:call-template>
980 </xsl:template>
981
982 <xsl:template name="foil-bottom-nav">
983   <xsl:param name="home"/>
984   <xsl:param name="up"/>
985   <xsl:param name="next"/>
986   <xsl:param name="prev"/>
987   <xsl:param name="tocfile" select="$toc.html"/>
988
989   <xsl:call-template name="bottom-nav">
990     <xsl:with-param name="home" select="$home"/>
991     <xsl:with-param name="up" select="$up"/>
992     <xsl:with-param name="next" select="$next"/>
993     <xsl:with-param name="prev" select="$prev"/>
994   </xsl:call-template>
995 </xsl:template>
996
997 <xsl:template match="foil/title">
998   <h1 class="{name(.)}">
999     <xsl:apply-templates/>
1000   </h1>
1001 </xsl:template>
1002
1003 <!-- ====================================================================== -->
1004 <!-- foilgroup -->
1005
1006 <xsl:template match="foilgroup">
1007   <xsl:param name="thisfoilgroup">
1008     <xsl:apply-templates select="." mode="chunk-filename"/>
1009   </xsl:param>
1010
1011   <xsl:variable name="id">
1012     <xsl:call-template name="object.id"/>
1013   </xsl:variable>
1014
1015   <xsl:variable name="home" select="/slides"/>
1016   <xsl:variable name="up" select="(parent::slides|parent::foilgroup)[1]"/>
1017   <xsl:variable name="next" select="foil[1]"/>
1018   <xsl:variable name="prev" select="(preceding::foil|parent::foilgroup|/slides)[last()]"/>
1019
1020   <xsl:call-template name="write.chunk">
1021     <xsl:with-param name="indent" select="$output.indent"/>
1022     <xsl:with-param name="filename" select="concat($base.dir, $thisfoilgroup)"/>
1023     <xsl:with-param name="content">
1024       <html>
1025         <head>
1026           <title><xsl:value-of select="title"/></title>
1027
1028           <xsl:call-template name="system.head.content"/>
1029
1030           <meta name="generator" content="DocBook Slides Stylesheets V{$VERSION}"/>
1031
1032           <!-- Links -->
1033           <xsl:if test="$css.stylesheet != ''">
1034             <link type="text/css" rel="stylesheet">
1035               <xsl:attribute name="href">
1036                 <xsl:call-template name="css.stylesheet"/>
1037               </xsl:attribute>
1038             </link>
1039           </xsl:if>
1040           <xsl:apply-templates select="/processing-instruction('dbhtml')" mode="css.pi"/>
1041
1042           <xsl:call-template name="links">
1043             <xsl:with-param name="home" select="$home"/>
1044             <xsl:with-param name="up" select="$up"/>
1045             <xsl:with-param name="next" select="$next"/>
1046             <xsl:with-param name="prev" select="$prev"/>
1047           </xsl:call-template>
1048
1049           <!-- Scripts -->
1050
1051           <xsl:if test="$overlay != 0 or $keyboard.nav != 0">
1052             <script language="javascript" type="text/javascript">
1053               <xsl:text> </xsl:text>
1054             </script>
1055           </xsl:if>
1056
1057           <xsl:if test="$keyboard.nav != 0">
1058             <xsl:call-template name="ua.js"/>
1059             <xsl:call-template name="xbDOM.js">
1060               <xsl:with-param name="language" select="'javascript'"/>
1061             </xsl:call-template>
1062             <xsl:call-template name="xbLibrary.js"/>
1063             <script language="javascript" type="text/javascript">
1064               <xsl:text disable-output-escaping="yes">
1065                 &lt;!--
1066                 xblibrary = new xbLibrary('</xsl:text>
1067               <xsl:call-template name="script-dir"/>
1068               <xsl:text disable-output-escaping="yes">');
1069                 // --&gt;
1070               </xsl:text>
1071             </script>
1072             <xsl:call-template name="xbStyle.js"/>
1073             <xsl:call-template name="xbCollapsibleLists.js"/>
1074             <xsl:call-template name="slides.js">
1075               <xsl:with-param name="language" select="'javascript'"/>
1076             </xsl:call-template>
1077           </xsl:if>
1078
1079           <xsl:if test="$overlay != '0'">
1080             <xsl:call-template name="overlay.js">
1081               <xsl:with-param name="language" select="'javascript'"/>
1082             </xsl:call-template>
1083           </xsl:if>
1084
1085           <xsl:call-template name="user.head.content"/>
1086         </head>
1087         <body>
1088           <xsl:attribute name="class">
1089             <xsl:value-of select="local-name(.)"/>
1090             <xsl:if test="@role">
1091               <xsl:text>-</xsl:text>
1092               <xsl:value-of select="@role"/>
1093             </xsl:if>
1094           </xsl:attribute>
1095
1096           <xsl:call-template name="body.attributes"/>
1097           <xsl:if test="$overlay != 0">
1098             <xsl:attribute name="onload">
1099               <xsl:text>overlaySetup('lc')</xsl:text>
1100             </xsl:attribute>
1101           </xsl:if>
1102           <xsl:if test="$keyboard.nav != 0">
1103             <xsl:attribute name="onkeypress">
1104               <xsl:text>navigate(event)</xsl:text>
1105             </xsl:attribute>
1106           </xsl:if>
1107
1108           <div class="{name(.)}" id="{$id}">
1109             <xsl:call-template name="foilgroup-top-nav">
1110               <xsl:with-param name="home" select="$home"/>
1111               <xsl:with-param name="up" select="$up"/>
1112               <xsl:with-param name="next" select="$next"/>
1113               <xsl:with-param name="prev" select="$prev"/>
1114             </xsl:call-template>
1115
1116             <!-- n.b. the foilgroup-body template is responsible for generating -->
1117             <!-- the foilgroup toc -->
1118             <div class="foilgroup-body">
1119               <xsl:call-template name="foilgroup-body">
1120                 <xsl:with-param name="home" select="$home"/>
1121                 <xsl:with-param name="up" select="$up"/>
1122                 <xsl:with-param name="next" select="$next"/>
1123                 <xsl:with-param name="prev" select="$prev"/>
1124               </xsl:call-template>
1125             </div>
1126
1127             <div id="overlayDiv">
1128               <xsl:call-template name="overlayDiv.attributes"/>
1129               <xsl:call-template name="foilgroup-bottom-nav">
1130                 <xsl:with-param name="home" select="$home"/>
1131                 <xsl:with-param name="up" select="$up"/>
1132                 <xsl:with-param name="next" select="$next"/>
1133                 <xsl:with-param name="prev" select="$prev"/>
1134               </xsl:call-template>
1135             </div>
1136           </div>
1137
1138           <xsl:call-template name="process.footnotes"/>
1139         </body>
1140       </html>
1141     </xsl:with-param>
1142   </xsl:call-template>
1143
1144   <xsl:apply-templates select="foil"/>
1145 </xsl:template>
1146
1147 <xsl:template match="foilgroup/title">
1148   <h1 class="{name(.)}"><xsl:apply-templates/></h1>
1149 </xsl:template>
1150
1151 <xsl:template name="foilgroup-body">
1152   <xsl:param name="home"/>
1153   <xsl:param name="up"/>
1154   <xsl:param name="next"/>
1155   <xsl:param name="prev"/>
1156   <xsl:param name="tocfile" select="$toc.html"/>
1157
1158   <xsl:apply-templates select="*[name(.) != 'foil'                                 and name(.) != 'foilgroup']"/>
1159
1160   <xsl:if test="$foilgroup.toc != 0">
1161     <dl class="toc">
1162       <xsl:apply-templates select="foil" mode="toc"/>
1163     </dl>
1164   </xsl:if>
1165 </xsl:template>
1166
1167 <xsl:template name="foilgroup-top-nav">
1168   <xsl:param name="home"/>
1169   <xsl:param name="up"/>
1170   <xsl:param name="next"/>
1171   <xsl:param name="prev"/>
1172   <xsl:param name="tocfile" select="$toc.html"/>
1173
1174   <xsl:call-template name="top-nav">
1175     <xsl:with-param name="home" select="$home"/>
1176     <xsl:with-param name="up" select="$up"/>
1177     <xsl:with-param name="next" select="$next"/>
1178     <xsl:with-param name="prev" select="$prev"/>
1179   </xsl:call-template>
1180 </xsl:template>
1181
1182 <xsl:template name="foilgroup-bottom-nav">
1183   <xsl:param name="home"/>
1184   <xsl:param name="up"/>
1185   <xsl:param name="next"/>
1186   <xsl:param name="prev"/>
1187   <xsl:param name="tocfile" select="$toc.html"/>
1188
1189   <xsl:call-template name="bottom-nav">
1190     <xsl:with-param name="home" select="$home"/>
1191     <xsl:with-param name="up" select="$up"/>
1192     <xsl:with-param name="next" select="$next"/>
1193     <xsl:with-param name="prev" select="$prev"/>
1194   </xsl:call-template>
1195 </xsl:template>
1196
1197 <!-- ====================================================================== -->
1198
1199 <xsl:template name="overlayDiv.attributes">
1200   <xsl:choose>
1201     <xsl:when test="$overlay != 0">
1202       <xsl:attribute name="style">
1203         <xsl:text>position: absolute; visibility: visible;</xsl:text>
1204       </xsl:attribute>
1205     </xsl:when>
1206     <xsl:otherwise>
1207       <xsl:attribute name="style">padding-top: 2in;</xsl:attribute>
1208     </xsl:otherwise>
1209   </xsl:choose>
1210 </xsl:template>
1211
1212 <!-- ====================================================================== -->
1213
1214 <xsl:template match="processing-instruction('dbhtml')" mode="css.pi">
1215   <xsl:variable name="href">
1216     <xsl:call-template name="dbhtml-attribute">
1217       <xsl:with-param name="pis" select="."/>
1218       <xsl:with-param name="attribute" select="'css-stylesheet'"/>
1219     </xsl:call-template>
1220   </xsl:variable>
1221
1222   <xsl:if test="$href!=''">
1223   <xsl:choose>
1224     <xsl:when test="$href = ''">
1225       <!-- nop -->
1226     </xsl:when>
1227     <xsl:when test="contains($href, '//')">
1228       <link type="text/css" rel="stylesheet" href="{$href}"/>
1229     </xsl:when>
1230     <xsl:when test="starts-with($href, '/')">
1231       <link type="text/css" rel="stylesheet" href="{$href}"/>
1232     </xsl:when>
1233     <xsl:otherwise>
1234       <link type="text/css" rel="stylesheet">
1235         <xsl:attribute name="href">
1236           <xsl:call-template name="css-file">
1237             <xsl:with-param name="css" select="$href"/>
1238           </xsl:call-template>
1239         </xsl:attribute>
1240       </link>
1241     </xsl:otherwise>
1242   </xsl:choose>
1243   </xsl:if>
1244
1245 </xsl:template>
1246
1247 <!-- ====================================================================== -->
1248
1249 <xsl:template match="foil" mode="number">
1250   <xsl:number count="foil|foilgroup" level="any"/>
1251 </xsl:template>
1252
1253 <xsl:template match="foilgroup" mode="number">
1254   <xsl:number count="foil|foilgroup" level="any"/>
1255 </xsl:template>
1256
1257 <!-- ====================================================================== -->
1258
1259 <xsl:template match="slides" mode="filename">
1260   <xsl:value-of select="$titlefoil.html"/>
1261 </xsl:template>
1262
1263 <xsl:template match="foil" mode="filename">
1264   <xsl:text>foil</xsl:text>
1265   <xsl:number count="foil" level="any" format="01"/>
1266   <xsl:value-of select="$html.ext"/>
1267 </xsl:template>
1268
1269 <xsl:template match="foilgroup" mode="filename">
1270   <xsl:text>foilgroup</xsl:text>
1271   <xsl:number count="foilgroup" level="any" format="01"/>
1272   <xsl:value-of select="$html.ext"/>
1273 </xsl:template>
1274
1275 <!-- ============================================================ -->
1276
1277 <xsl:template match="processing-instruction('Pub')">
1278   <xsl:variable name="pidata"><xsl:value-of select="(.)"/></xsl:variable>
1279   <xsl:choose>
1280     <xsl:when test="contains($pidata,'UDT')"/>
1281     <xsl:when test="contains($pidata,'/_font')">
1282       <xsl:text disable-output-escaping="yes">&lt;/span&gt;</xsl:text>
1283     </xsl:when>
1284     <xsl:when test="contains($pidata,'_font')">
1285       <xsl:text disable-output-escaping="yes">&lt;span </xsl:text>
1286       <xsl:choose>
1287         <xsl:when test="contains($pidata,'green')">class="green"</xsl:when>
1288         <xsl:when test="contains($pidata,'blue')">class="blue"</xsl:when>
1289         <xsl:when test="contains($pidata,'orange')">class="orange"</xsl:when>
1290         <xsl:when test="contains($pidata,'red')">class="red"</xsl:when>
1291         <xsl:when test="contains($pidata,'brown')">class="brown"</xsl:when>
1292         <xsl:when test="contains($pidata,'violet')">class="violet"</xsl:when>
1293         <xsl:when test="contains($pidata,'black')">class="black"</xsl:when>
1294         <xsl:otherwise>class="bold"</xsl:otherwise>
1295       </xsl:choose>
1296       <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
1297     </xsl:when>
1298   </xsl:choose>
1299 </xsl:template>
1300
1301 <!-- ============================================================ -->
1302 <!-- blocks -->
1303
1304 <xsl:template match="figure">
1305   <div class="{name(.)}">
1306     <xsl:apply-imports/>
1307   </div>
1308   <xsl:if test="following-sibling::*"><hr/></xsl:if>
1309 </xsl:template>
1310
1311 <xsl:template match="copyright" mode="slide.footer.mode">
1312   <span class="{name(.)}">
1313     <xsl:call-template name="gentext">
1314       <xsl:with-param name="key" select="'Copyright'"/>
1315     </xsl:call-template>
1316     <xsl:call-template name="gentext.space"/>
1317     <xsl:call-template name="dingbat">
1318       <xsl:with-param name="dingbat">copyright</xsl:with-param>
1319     </xsl:call-template>
1320     <xsl:call-template name="gentext.space"/>
1321     <xsl:call-template name="copyright.years">
1322       <xsl:with-param name="years" select="year"/>
1323       <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
1324       <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/>
1325     </xsl:call-template>
1326     <xsl:call-template name="gentext.space"/>
1327     <xsl:apply-templates select="holder" mode="titlepage.mode"/>
1328   </span>
1329 </xsl:template>
1330
1331 <!-- ============================================================ -->
1332 <!-- inlines -->
1333
1334 <xsl:template match="link">
1335   <xsl:call-template name="link">
1336     <xsl:with-param name="a.target" select="'foil'"/>
1337   </xsl:call-template>
1338 </xsl:template>
1339
1340 <xsl:template match="ulink">
1341   <a>
1342     <xsl:if test="@id">
1343       <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1344     </xsl:if>
1345     <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
1346     <xsl:if test="$ulink.target != ''">
1347       <xsl:attribute name="target">
1348         <xsl:value-of select="$ulink.target"/>
1349       </xsl:attribute>
1350     </xsl:if>
1351     <xsl:choose>
1352       <xsl:when test="count(child::node())=0">
1353         <xsl:value-of select="@url"/>
1354       </xsl:when>
1355       <xsl:otherwise>
1356         <xsl:apply-templates/>
1357         <xsl:if test="@role='show'">
1358           <xsl:text> (</xsl:text>
1359           <xsl:value-of select="@url"/>
1360           <xsl:text>)</xsl:text>
1361         </xsl:if>
1362       </xsl:otherwise>
1363     </xsl:choose>
1364   </a>
1365 </xsl:template>
1366
1367 <xsl:template match="title/ulink">
1368   <a>
1369     <xsl:if test="@id">
1370       <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1371     </xsl:if>
1372     <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
1373     <xsl:if test="$ulink.target != ''">
1374       <xsl:attribute name="target">
1375         <xsl:value-of select="$ulink.target"/>
1376       </xsl:attribute>
1377     </xsl:if>
1378     <xsl:choose>
1379       <xsl:when test="count(child::node())=0">
1380         <xsl:value-of select="@url"/>
1381       </xsl:when>
1382       <xsl:otherwise>
1383         <xsl:apply-templates/>
1384       </xsl:otherwise>
1385     </xsl:choose>
1386   </a>
1387 </xsl:template>
1388
1389 <xsl:template match="subtitle">
1390   <h2 class="subtitle">
1391     <xsl:apply-templates/>
1392   </h2>
1393 </xsl:template>
1394
1395 <xsl:template match="graphic">
1396   <center>
1397     <!-- can't this be done a better way? -->
1398     <xsl:apply-imports/>
1399   </center>
1400 </xsl:template>
1401
1402 <xsl:template match="titleabbrev">
1403   <!-- nop -->
1404 </xsl:template>
1405
1406 <xsl:template match="speakernotes">
1407   <!-- nop -->
1408 </xsl:template>
1409
1410 <!-- ====================================================================== -->
1411 <!-- Chunking for slides -->
1412
1413 <xsl:template name="chunk">
1414   <xsl:param name="node" select="."/>
1415   <xsl:choose>
1416     <xsl:when test="name($node)='slides'">1</xsl:when>
1417     <xsl:when test="name($node)='foilgroup'">1</xsl:when>
1418     <xsl:when test="name($node)='foil'">1</xsl:when>
1419     <xsl:otherwise>0</xsl:otherwise>
1420   </xsl:choose>
1421 </xsl:template>
1422
1423 <xsl:template match="*" mode="chunk-filename">
1424   <xsl:param name="recursive">0</xsl:param>
1425   <!-- returns the filename of a chunk -->
1426   <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
1427   <xsl:variable name="filename">
1428     <xsl:call-template name="pi.dbhtml_filename"/>
1429   </xsl:variable>
1430   <xsl:variable name="dir">
1431     <xsl:call-template name="dbhtml-dir"/>
1432   </xsl:variable>
1433
1434   <xsl:choose>
1435     <xsl:when test="$ischunk='0'">
1436       <!-- if called on something that isn't a chunk, walk up... -->
1437       <xsl:choose>
1438         <xsl:when test="count(./parent::*)&gt;0">
1439           <xsl:apply-templates mode="chunk-filename" select="./parent::*">
1440             <xsl:with-param name="recursive" select="$recursive"/>
1441           </xsl:apply-templates>
1442         </xsl:when>
1443         <!-- unless there is no up, in which case return "" -->
1444         <xsl:otherwise/>
1445       </xsl:choose>
1446     </xsl:when>
1447
1448     <xsl:when test="not($recursive) and $filename != ''">
1449       <!-- if this chunk has an explicit name, use it -->
1450       <xsl:if test="$dir != ''">
1451         <xsl:value-of select="$dir"/>
1452         <xsl:text>/</xsl:text>
1453       </xsl:if>
1454       <xsl:value-of select="$filename"/>
1455     </xsl:when>
1456
1457     <xsl:when test="name(.)='foil'">
1458       <xsl:variable name="foilnumber">
1459         <xsl:number count="foil" level="any"/>
1460       </xsl:variable>
1461
1462       <xsl:value-of select="$dir"/>
1463       <xsl:text>foil</xsl:text>
1464       <xsl:number value="$foilnumber" format="01"/>
1465       <xsl:value-of select="$html.ext"/>
1466     </xsl:when>
1467
1468     <xsl:when test="name(.)='foilgroup'">
1469       <xsl:variable name="foilgroupnumber">
1470         <xsl:number count="foilgroup" level="any" format="01"/>
1471       </xsl:variable>
1472
1473       <xsl:value-of select="$dir"/>
1474       <xsl:text>foilgroup</xsl:text>
1475       <xsl:number value="$foilgroupnumber" format="01"/>
1476       <xsl:value-of select="$html.ext"/>
1477     </xsl:when>
1478
1479     <xsl:otherwise>
1480       <xsl:text>chunk-filename-error-</xsl:text>
1481       <xsl:value-of select="name(.)"/>
1482       <xsl:number level="any" format="01" from="set"/>
1483       <xsl:if test="not($recursive)">
1484         <xsl:value-of select="$html.ext"/>
1485       </xsl:if>
1486     </xsl:otherwise>
1487   </xsl:choose>
1488 </xsl:template>
1489
1490 <!-- ====================================================================== -->
1491 <!-- Handling of xrefs -->
1492
1493 <xsl:template match="foil|foilgroup" mode="xref-to">
1494   <xsl:param name="referrer"/>
1495   <xsl:param name="xrefstyle"/>
1496
1497   <xsl:apply-templates select="." mode="object.xref.markup">
1498     <xsl:with-param name="purpose" select="'xref'"/>
1499     <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
1500     <xsl:with-param name="referrer" select="$referrer"/>
1501   </xsl:apply-templates>
1502 </xsl:template>
1503
1504 <!-- ====================================================================== -->
1505
1506 <xsl:template match="@*" mode="copy">
1507   <xsl:attribute name="{local-name(.)}">
1508     <xsl:value-of select="."/>
1509   </xsl:attribute>
1510 </xsl:template>
1511
1512 <xsl:template xmlns:html="http://www.w3.org/1999/xhtml" match="html:*">
1513   <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
1514     <xsl:apply-templates select="@*" mode="copy"/>
1515     <xsl:apply-templates/>
1516   </xsl:element>
1517 </xsl:template>
1518
1519 <!-- ====================================================================== -->
1520
1521 <xsl:template name="foil.number">
1522   <xsl:choose>
1523     <xsl:when test="$show.foil.number != 0 and self::foil">
1524       <xsl:number count="foil" level="any"/>
1525       /
1526       <xsl:value-of select="count(//foil)"/>
1527     </xsl:when>
1528     <xsl:otherwise>
1529       &#160;
1530     </xsl:otherwise>
1531   </xsl:choose>
1532 </xsl:template>
1533
1534 </xsl:stylesheet>