1 <?xml version="1.0" encoding="ASCII"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns="http://www.w3.org/1999/xhtml"
4 xmlns:xlink="http://www.w3.org/1999/xlink"
5 xmlns:db="http://docbook.org/ns/docbook"
6 xmlns:dbs="http://docbook.org/ns/docbook-slides"
7 xmlns:exsl="http://exslt.org/common"
8 exclude-result-prefixes="dbs db xlink"
9 extension-element-prefixes="exsl"
12 <xsl:import href="../../xhtml/chunk.xsl"/>
13 <xsl:import href="../common/common.xsl"/>
14 <xsl:import href="plain-titlepage.xsl"/>
15 <xsl:import href="param.xsl"/>
17 <xsl:param name="local.l10n.xml" select="document('')"/>
18 <i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
19 <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
20 <l:gentext key="Foilgroup" text="Foil Group"/>
21 <l:gentext key="Foil" text="Foil"/>
22 <l:gentext key="Speakernotes" text="Speaker Notes"/>
23 <l:gentext key="Handoutnotes" text="Handout Notes"/>
24 <l:gentext key="SVGImage" text="SVG image"/>
25 <l:gentext key="MathMLFormula" text="MathML formula"/>
27 <l:context name="title">
28 <l:gentext key="foil" text="Foil %n %t"/>
29 <l:gentext key="foilgroup" text="Foil %n %t"/>
34 <!-- Overrides from DocBook XSL -->
35 <xsl:template name="process.qanda.toc"/>
37 <!-- Main content starts here -->
39 <xsl:template name="xhtml.head">
40 <meta name="generator" content="DocBook Slides Stylesheets V{$VERSION}"/>
41 <link rel="stylesheet" href="{$user.css}" type="text/css"/>
44 <xsl:template name="slideshow.head"/>
46 <xsl:template name="slideshow.content">
47 <div class="presentation">
48 <xsl:if test="$generate.titlepage != 0">
49 <xsl:apply-templates select="/dbs:slides" mode="titlepage"/>
52 <xsl:apply-templates select="/dbs:slides/dbs:foil|dbs:slides/dbs:foilgroup"/>
56 <xsl:template match="/dbs:slides" mode="titlepage">
57 <xsl:call-template name="slides.titlepage"/>
60 <xsl:template name="slide.notes">
61 <xsl:if test="($generate.speakernotes != 0) and ./dbs:speakernotes">
64 <xsl:call-template name="gentext">
65 <xsl:with-param name="key" select="'Speakernotes'"/>
69 <xsl:apply-templates select="dbs:speakernotes" mode="notes.mode"/>
73 <xsl:if test="($generate.handoutnotes != 0) and ./dbs:handoutnotes">
76 <xsl:call-template name="gentext">
77 <xsl:with-param name="key" select="'Handoutnotes'"/>
81 <xsl:apply-templates select="dbs:handoutnotes" mode="notes.mode"/>
86 <xsl:template match="/">
88 <xsl:if test="/dbs:slides/@xml:lang">
89 <xsl:attribute name="xml:lang">
90 <xsl:value-of select="/dbs:slides/@xml:lang"/>
96 <xsl:call-template name="get.title">
97 <xsl:with-param name="ctx" select="/dbs:slides"/>
101 <xsl:call-template name="xhtml.head"/>
105 <xsl:call-template name="slideshow.head"/>
107 <xsl:call-template name="slideshow.content"/>
112 <xsl:template name="foilgroup.content">
113 <xsl:apply-templates select="*[not(self::dbs:foil)]"/>
115 <xsl:if test="($generate.foilgroup.toc != 0)">
117 <xsl:when test="($generate.foilgroup.numbered.toc != 0)">
119 <xsl:for-each select="dbs:foil">
120 <li><xsl:call-template name="get.title"/></li>
127 <xsl:for-each select="dbs:foil">
128 <li><xsl:call-template name="get.title"/></li>
136 <xsl:template name="foil.classes">
137 <xsl:variable name="classValue">
138 <xsl:call-template name="process.dbs.attributes">
139 <!-- Do not put incremental or collapsible on foils -->
140 <xsl:with-param name="attributeSet" select="self::*/@dbs:style"/>
141 <xsl:with-param name="stored">
142 <xsl:value-of select="'slide'"/>
143 <xsl:if test="@*[namespace-uri() = 'http://docbook.org/ns/docbook-slides']">
144 <xsl:text> </xsl:text>
150 <xsl:attribute name="class">
151 <xsl:value-of select="$classValue"/>
155 <xsl:template match="dbs:foilgroup">
156 <xsl:call-template name="generate.anchor"/>
158 <xsl:call-template name="foil.classes"/>
161 <xsl:when test="($wrap.slidecontent != 0)">
162 <div class="slidecontent">
163 <xsl:call-template name="foilgroup.content"/>
168 <xsl:call-template name="foilgroup.content"/>
172 <xsl:call-template name="slide.notes"/>
175 <xsl:apply-templates select="dbs:foil"/>
178 <xsl:template match="dbs:foil">
179 <xsl:call-template name="generate.anchor"/>
181 <xsl:call-template name="foil.classes"/>
184 <xsl:when test="($wrap.slidecontent != 0)">
185 <div class="slidecontent">
186 <xsl:apply-templates select="*"/>
191 <xsl:apply-templates/>
195 <xsl:call-template name="process.footnotes"/>
197 <xsl:call-template name="slide.notes"/>
201 <xsl:template match="dbs:handoutnotes"/>
203 <xsl:template match="dbs:speakernotes"/>
205 <xsl:template match="dbs:handoutnotes" mode="notes.mode">
206 <div class="handoutnotes">
207 <xsl:apply-templates/>
211 <xsl:template match="dbs:speakernotes" mode="notes.mode">
212 <div class="speakernotes">
213 <xsl:apply-templates/>
217 <xsl:template name="process.dbs.attributes">
218 <xsl:param name="attributeSet"/>
219 <xsl:param name="stored" select="''"/>
221 <xsl:variable name="gotIncremental">
222 <xsl:if test="((local-name($attributeSet[1]) = 'incremental') and ($attributeSet[1] = '1'))">1</xsl:if>
225 <xsl:variable name="enableIncremental">
226 <xsl:if test="($disable.incremental = '0') and ($gotIncremental = '1')">1</xsl:if>
229 <xsl:variable name="gotCollapsible">
230 <xsl:if test="((local-name($attributeSet[1]) = 'collapsible') and ($attributeSet[1] = '1'))">1</xsl:if>
233 <xsl:variable name="enableCollapsible">
234 <xsl:if test="($disable.collapsible = '0') and ($gotCollapsible = '1')">1</xsl:if>
237 <xsl:variable name="append">
239 <xsl:when test="local-name($attributeSet[1]) = 'style'">
240 <xsl:value-of select="$attributeSet[1]"/>
243 <xsl:when test="$enableCollapsible = '1'">
244 <xsl:value-of select="'outline'"/>
247 <xsl:when test="$enableIncremental = '1'">
248 <xsl:value-of select="'incremental'"/>
252 <xsl:if test="count($attributeSet) > 1">
253 <xsl:text> </xsl:text>
258 <xsl:when test="not($attributeSet)">
259 <xsl:value-of select="$stored"/>
262 <xsl:when test="count($attributeSet) <= 1">
263 <xsl:value-of select="concat($stored, $append)"/>
267 <xsl:call-template name="process.dbs.attributes">
268 <xsl:with-param name="attributeSet" select="$attributeSet[position() != 1]"/>
269 <xsl:with-param name="stored" select="concat($stored, $append)"/>
275 <xsl:template match="dbs:block">
276 <xsl:variable name="classValue">
277 <xsl:call-template name="process.dbs.attributes">
278 <xsl:with-param name="attributeSet" select="(ancestor-or-self::*/@dbs:incremental)[last()] | (ancestor-or-self::*/@dbs:collapsible)[last()] | self::*/@dbs:style"/>
282 <div class="{$classValue}">
283 <xsl:apply-templates/>
287 <xsl:template match="db:info">
288 <xsl:apply-templates select="db:title|db:titleabbrev|db:subtitle|db:author|db:authorgroup/db:author"/>
291 <xsl:template match="db:title|db:titleabbrev">
292 <xsl:if test="not(self::db:title) or (not(preceding-sibling::db:titleabbrev) and not(following-sibling::db:titleabbrev))">
293 <h1 class="title"><xsl:value-of select="."/></h1>
297 <xsl:template match="db:subtitle">
298 <h1 class="subtitle"><xsl:value-of select="."/></h1>
301 <xsl:template match="db:author">
302 <h3 class="author"><xsl:apply-templates select="db:personname|db:orgname"/></h3>
303 <h4 class="email"><xsl:apply-templates select="db:email"/></h4>
304 <xsl:if test="db:affiliation">
305 <h4 class="affiliation"><xsl:value-of select="db:affiliation"/></h4>
309 <xsl:template match="db:email">
311 <xsl:attribute name="href">
312 <xsl:text>mailto:</xsl:text><xsl:value-of select="."/>
315 <<xsl:value-of select="."/>>
319 <xsl:template name="list.content">
320 <xsl:variable name="classValue">
321 <xsl:call-template name="process.dbs.attributes">
322 <xsl:with-param name="attributeSet" select="(ancestor-or-self::*/@dbs:incremental)[last()] | (ancestor-or-self::*/@dbs:collapsible)[last()] | self::*/@dbs:style"/>
326 <xsl:attribute name="class">
327 <xsl:value-of select="$classValue"/>
330 <xsl:apply-templates select="*"/>
333 <xsl:template match="db:itemizedlist">
335 <xsl:call-template name="list.content"/>
339 <xsl:template match="db:orderedlist">
341 <xsl:call-template name="list.content"/>
345 <xsl:template match="db:mediaobject">
346 <xsl:variable name="classValue">
347 <xsl:call-template name="process.dbs.attributes">
348 <xsl:with-param name="attributeSet" select="(ancestor-or-self::*/@dbs:incremental)[last()] | (ancestor-or-self::*/@dbs:collapsible)[last()] | self::*/@dbs:style"/>
352 <div class="{$classValue}">
353 <xsl:apply-templates select="db:imageobject[1]"/>
357 <xsl:template name="bibliography.titlepage"/>
359 <xsl:template match="db:bibliosource" mode="bibliography.mode">
361 <xsl:call-template name="common.html.attributes"/>
362 <xsl:call-template name="id.attribute"/>
364 <xsl:when test="@xlink:href">
365 <a href="{@xlink:href}">
366 <xsl:apply-templates mode="bibliography.mode"/>
371 <xsl:apply-templates mode="bibliomixed.mode"/>
377 <xsl:template name="href.target.uri">
378 <xsl:param name="object" select="."/>
379 <xsl:variable name="ischunk">
380 <xsl:call-template name="chunk">
381 <xsl:with-param name="node" select="$object"/>
385 <xsl:if test="$ischunk='0'">
386 <xsl:text>#</xsl:text>
387 <xsl:call-template name="object.id">
388 <xsl:with-param name="object" select="$object"/>
393 <xsl:template match="dbs:foil|dbs:foilgroup" mode="xref-to">
394 <xsl:call-template name="gentext">
395 <xsl:with-param name="key" select="'Foil'"/>
397 <xsl:call-template name="gentext.space"/>
398 <xsl:value-of select="count(preceding::dbs:foil|preceding::dbs:foilgroup) + 1"/>
399 <xsl:text>: </xsl:text>
400 <xsl:call-template name="get.title"/>
403 <xsl:template name="extension.process.image.attributes">
404 <xsl:variable name="classValue">
405 <xsl:call-template name="process.dbs.attributes">
406 <xsl:with-param name="attributeSet" select="(ancestor-or-self::*/@dbs:incremental)[last()] | (ancestor-or-self::*/@dbs:collapsible)[last()] | self::*/@dbs:style"/>
410 <xsl:if test="./@*[namespace-uri() = 'http://docbook.org/ns/docbook-slides']">
411 <xsl:attribute name="class">
412 <xsl:value-of select="$classValue"/>
417 <xsl:template match="*[namespace-uri() = 'http://www.w3.org/2000/svg']">
418 <xsl:call-template name="handle.embedded">
419 <xsl:with-param name="modeParam" select="$svg.embedding.mode"/>
420 <xsl:with-param name="fileExt" select="'.svg'"/>
421 <xsl:with-param name="mimeType" select="'image/svg+xml'"/>
422 <xsl:with-param name="gentextKey" select="'SVGImage'"/>
426 <xsl:template match="*[namespace-uri() = 'http://www.w3.org/1998/Math/MathML']">
427 <xsl:call-template name="handle.embedded">
428 <xsl:with-param name="modeParam" select="$mml.embedding.mode"/>
429 <xsl:with-param name="fileExt" select="'.mml'"/>
430 <xsl:with-param name="mimeType" select="'application/mathml-presentation+xml'"/>
431 <xsl:with-param name="gentextKey" select="'MathMLFormula'"/>
435 <xsl:template name="handle.embedded">
436 <xsl:param name="modeParam">inline</xsl:param>
437 <xsl:param name="fileExt"/>
438 <xsl:param name="mimeType"/>
439 <xsl:param name="gentextKey"/>
442 <xsl:when test="$modeParam = 'inline'">
443 <xsl:copy-of select="."/>
447 <xsl:variable name="id">
448 <xsl:call-template name="object.id"/>
450 <xsl:variable name="fname">
451 <xsl:value-of select="concat($id, $fileExt)"/>
454 <exsl:document href="{$fname}">
455 <xsl:copy-of select="."/>
459 <xsl:when test="$modeParam = 'object'">
460 <object data="{$fname}" type="{$mimeType}"/>
463 <xsl:when test="$modeParam = 'image'">
464 <img alt="{$mimeType} object" src="{$fname}"/>
467 <xsl:when test="$modeParam = 'link'">
469 <xsl:call-template name="gentext">
470 <xsl:with-param name="key" select="$gentextKey"/>
475 <xsl:when test="$modeParam = 'iframe'">
476 <iframe src="{$fname}"/>
479 <xsl:when test="$modeParam = 'embed'">
480 <embed src="{$fname}" type="{$mimeType}" />
484 <xsl:message terminate="yes">
485 Unknown processing mode <xsl:value-of select="$modeParam"/>.
493 <xsl:template name="generate.anchor">
495 <xsl:attribute name="name">
496 <xsl:call-template name="object.id"/>
501 <xsl:template name="slide.copyright">
502 <div class="copyright">
503 <xsl:call-template name="gentext">
504 <xsl:with-param name="key" select="'Copyright'"/>
506 <xsl:call-template name="gentext.space"/>
507 <xsl:text>©</xsl:text>
508 <xsl:call-template name="gentext.space"/>
509 <xsl:value-of select="/dbs:slides/db:info/db:copyright/db:year"/>
510 <xsl:call-template name="gentext.space"/>
511 <xsl:value-of select="/dbs:slides/db:info/db:copyright/db:holder"/>
515 <xsl:template name="slide.pubdate">
516 <div class="pubdate">
517 <xsl:call-template name="gentext">
518 <xsl:with-param name="key" select="'Published'"/>
520 <xsl:text>: </xsl:text>
521 <xsl:value-of select="/dbs:slides/db:info/db:pubdate"/>
525 <xsl:template match="/" mode="slide.header.mode"/>
527 <xsl:template match="/" mode="slide.footer.mode">
528 <xsl:if test="($generate.copyright != 0) and /dbs:slides/db:info/db:copyright">
529 <xsl:call-template name="slide.copyright"/>
531 <xsl:if test="($generate.pubdate != 0) and /dbs:slides/db:info/db:pubdate">
532 <xsl:call-template name="slide.pubdate"/>