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