2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
   3                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
 
   4                 xmlns:rx="http://www.renderx.com/XSL/Extensions"
 
   7 <!-- ********************************************************************
 
   8      $Id: plain.xsl 8101 2008-08-03 18:35:14Z mzjn $
 
   9      ********************************************************************
 
  11      This file is part of the DocBook Slides Stylesheet distribution.
 
  12      See ../README or http://docbook.sf.net/release/xsl/current/ for
 
  13      copyright and other information.
 
  15      ******************************************************************** -->
 
  17 <xsl:import href="../../fo/docbook.xsl"/>
 
  18 <xsl:import href="param.xsl"/>
 
  20 <xsl:param name="alignment" select="'start'"/>
 
  22 <xsl:include href="plain-titlepage.xsl"/>
 
  24 <xsl:param name="local.l10n.xml" select="document('')"/>
 
  25 <i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
 
  26   <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
 
  27     <l:gentext key="Continued" text="(Continued)"/>
 
  28     <l:context name="title">
 
  29       <l:template name="slides" text="%t"/>
 
  30       <l:template name="foilgroup" text="%t"/>
 
  31       <l:template name="foil" text="%t"/>
 
  36 <xsl:variable name="root.elements" select="' slides '"/>
 
  38 <xsl:param name="preferred.mediaobject.role" select="'print'"/>
 
  40 <xsl:param name="page.orientation" select="'landscape'"/>
 
  42 <xsl:param name="body.font.master" select="24"/>
 
  44 <xsl:attribute-set name="formal.title.properties"
 
  45                    use-attribute-sets="normal.para.spacing">
 
  46   <xsl:attribute name="font-weight">bold</xsl:attribute>
 
  47   <xsl:attribute name="font-size">
 
  48     <xsl:value-of select="$body.font.master * 1.2"/>
 
  49     <xsl:text>pt</xsl:text>
 
  51   <xsl:attribute name="hyphenate">false</xsl:attribute>
 
  52   <xsl:attribute name="space-after.minimum">8pt</xsl:attribute>
 
  53   <xsl:attribute name="space-after.optimum">6pt</xsl:attribute>
 
  54   <xsl:attribute name="space-after.maximum">10pt</xsl:attribute>
 
  57 <xsl:attribute-set name="list.block.spacing">
 
  58   <xsl:attribute name="space-before.optimum">12pt</xsl:attribute>
 
  59   <xsl:attribute name="space-before.minimum">8pt</xsl:attribute>
 
  60   <xsl:attribute name="space-before.maximum">14pt</xsl:attribute>
 
  61   <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
 
  62   <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
 
  63   <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
 
  66 <xsl:attribute-set name="list.item.spacing">
 
  67   <xsl:attribute name="space-before.optimum">6pt</xsl:attribute>
 
  68   <xsl:attribute name="space-before.minimum">4pt</xsl:attribute>
 
  69   <xsl:attribute name="space-before.maximum">8pt</xsl:attribute>
 
  72 <xsl:attribute-set name="normal.para.spacing">
 
  73   <xsl:attribute name="space-before.optimum">8pt</xsl:attribute>
 
  74   <xsl:attribute name="space-before.minimum">6pt</xsl:attribute>
 
  75   <xsl:attribute name="space-before.maximum">10pt</xsl:attribute>
 
  78 <xsl:attribute-set name="slides.titlepage.recto.style">
 
  79   <xsl:attribute name="font-family">
 
  80     <xsl:value-of select="$slide.font.family"/>
 
  84 <xsl:attribute-set name="slides.titlepage.verso.style">
 
  85   <xsl:attribute name="font-family">
 
  86     <xsl:value-of select="$slide.font.family"/>
 
  90 <!-- ============================================================ -->
 
  92 <xsl:param name="page.margin.top" select="'0.25in'"/>
 
  93 <xsl:param name="region.before.extent" select="'0.75in'"/>
 
  94 <xsl:param name="body.margin.top" select="'1in'"/>
 
  96 <xsl:param name="region.after.extent" select="'0.5in'"/>
 
  97 <xsl:param name="body.margin.bottom" select="'0.5in'"/>
 
  98 <xsl:param name="page.margin.bottom" select="'0.25in'"/>
 
 100 <xsl:param name="page.margin.inner" select="'0.25in'"/>
 
 101 <xsl:param name="page.margin.outer" select="'0.25in'"/>
 
 102 <xsl:param name="column.count.body" select="1"/>
 
 104 <xsl:template name="user.pagemasters">
 
 105   <fo:simple-page-master master-name="slides-titlepage-master"
 
 106                          page-width="{$page.width}"
 
 107                          page-height="{$page.height}"
 
 108                          margin-top="{$page.margin.top}"
 
 109                          margin-bottom="{$page.margin.bottom}"
 
 110                          margin-left="{$page.margin.inner}"
 
 111                          margin-right="{$page.margin.outer}">
 
 112     <fo:region-body margin-bottom="0pt"
 
 114                     column-count="{$column.count.body}">
 
 116   </fo:simple-page-master>
 
 118   <fo:simple-page-master master-name="slides-foil-master"
 
 119                          page-width="{$page.width}"
 
 120                          page-height="{$page.height}"
 
 121                          margin-top="{$page.margin.top}"
 
 122                          margin-bottom="{$page.margin.bottom}"
 
 123                          margin-left="{$page.margin.inner}"
 
 124                          margin-right="{$page.margin.outer}">
 
 125     <fo:region-body margin-bottom="{$body.margin.bottom}"
 
 126                     margin-top="{$body.margin.top}"
 
 127                     column-count="{$column.count.body}">
 
 129     <fo:region-before region-name="xsl-region-before-foil"
 
 130                       extent="{$region.before.extent}"
 
 131                       display-align="before"/>
 
 132     <fo:region-after region-name="xsl-region-after-foil"
 
 133                      extent="{$region.after.extent}"
 
 134                      display-align="after"/>
 
 135   </fo:simple-page-master>
 
 137   <fo:simple-page-master master-name="slides-foil-continued-master"
 
 138                          page-width="{$page.width}"
 
 139                          page-height="{$page.height}"
 
 140                          margin-top="{$page.margin.top}"
 
 141                          margin-bottom="{$page.margin.bottom}"
 
 142                          margin-left="{$page.margin.inner}"
 
 143                          margin-right="{$page.margin.outer}">
 
 144     <fo:region-body margin-bottom="{$body.margin.bottom}"
 
 145                     margin-top="{$body.margin.top}"
 
 146                     column-count="{$column.count.body}">
 
 148     <fo:region-before region-name="xsl-region-before-foil-continued"
 
 149                       extent="{$region.before.extent}"
 
 150                       display-align="before"/>
 
 151     <fo:region-after region-name="xsl-region-after-foil-continued"
 
 152                      extent="{$region.after.extent}"
 
 153                      display-align="after"/>
 
 154   </fo:simple-page-master>
 
 156   <fo:page-sequence-master master-name="slides-titlepage">
 
 157     <fo:repeatable-page-master-alternatives>
 
 158       <fo:conditional-page-master-reference master-reference="slides-titlepage-master"/>
 
 159     </fo:repeatable-page-master-alternatives>
 
 160   </fo:page-sequence-master>
 
 162   <fo:page-sequence-master master-name="slides-foil">
 
 163     <fo:repeatable-page-master-alternatives>
 
 164       <fo:conditional-page-master-reference master-reference="slides-foil-master"
 
 165                                             page-position="first"/>
 
 166       <fo:conditional-page-master-reference master-reference="slides-foil-continued-master"/>
 
 167     </fo:repeatable-page-master-alternatives>
 
 168   </fo:page-sequence-master>
 
 171 <xsl:template match="*" mode="running.head.mode">
 
 172   <xsl:param name="master-reference" select="'unknown'"/>
 
 173   <!-- use the foilgroup title if there is one -->
 
 174   <fo:static-content flow-name="xsl-region-before-foil">
 
 175     <fo:block background-color="white"
 
 177               font-size="{$foil.title.size}"
 
 180               font-family="{$slide.title.font.family}">
 
 181       <xsl:apply-templates select="title" mode="titlepage.mode"/>
 
 185   <fo:static-content flow-name="xsl-region-before-foil-continued">
 
 186     <fo:block background-color="white"
 
 188               font-size="{$foil.title.size}"
 
 191               font-family="{$slide.title.font.family}">
 
 192       <xsl:apply-templates select="title" mode="titlepage.mode"/>
 
 193       <xsl:text> </xsl:text>
 
 194       <xsl:call-template name="gentext">
 
 195         <xsl:with-param name="key" select="'Continued'"/>
 
 201 <xsl:template match="*" mode="running.foot.mode">
 
 202   <xsl:param name="master-reference" select="'unknown'"/>
 
 204   <xsl:variable name="last-slide"
 
 205                 select="(//foil|//foilgroup)[last()]"/>
 
 207   <xsl:variable name="last-id">
 
 209       <xsl:when test="$last-slide/@id">
 
 210         <xsl:value-of select="$last-slide/@id"/>
 
 213         <xsl:value-of select="generate-id($last-slide)"/>
 
 218   <xsl:variable name="content">
 
 219     <fo:table table-layout="fixed" width="100%"
 
 220               xsl:use-attribute-sets="running.foot.properties">
 
 221       <fo:table-column column-number="1" column-width="33%"/>
 
 222       <fo:table-column column-number="2" column-width="34%"/>
 
 223       <fo:table-column column-number="3" column-width="33%"/>
 
 225         <fo:table-row height="14pt">
 
 226           <fo:table-cell text-align="left">
 
 228               <xsl:if test="self::foil">
 
 230                   <xsl:when test="ancestor::foilgroup[1]/titleabbrev">
 
 231                     <xsl:apply-templates select="ancestor::foilgroup[1]/titleabbrev"
 
 232                                          mode="titlepage.mode"/>
 
 235                     <xsl:apply-templates select="ancestor::foilgroup[1]/title"
 
 236                                          mode="titlepage.mode"/>
 
 242           <fo:table-cell text-align="center">
 
 244               <xsl:if test="/slides/slidesinfo/releaseinfo[@role='copyright']">
 
 245                 <xsl:apply-templates select="/slides/slidesinfo/releaseinfo[@role='copyright']"
 
 247                 <xsl:text>   </xsl:text>
 
 249               <xsl:apply-templates select="/slides/slidesinfo/copyright"
 
 250                                    mode="titlepage.mode"/>
 
 253           <fo:table-cell text-align="right">
 
 256               <xsl:text> / </xsl:text>
 
 257               <fo:page-number-citation ref-id="{$last-id}"/>
 
 265   <fo:static-content flow-name="xsl-region-after-foil">
 
 267       <xsl:copy-of select="$content"/>
 
 271   <fo:static-content flow-name="xsl-region-after-foil-continued">
 
 273       <xsl:copy-of select="$content"/>
 
 278 <xsl:template name="select.user.pagemaster">
 
 279   <xsl:param name="element"/>
 
 280   <xsl:param name="pageclass"/>
 
 281   <xsl:param name="default-pagemaster"/>
 
 284     <xsl:when test="$element = 'slides'">slides-titlepage</xsl:when>
 
 285     <xsl:otherwise>slides-foil</xsl:otherwise>
 
 289 <xsl:template match="slides">
 
 290   <xsl:variable name="master-reference">
 
 291     <xsl:call-template name="select.pagemaster"/>
 
 294   <fo:page-sequence hyphenate="{$hyphenate}"
 
 295                     master-reference="{$master-reference}">
 
 296     <xsl:attribute name="language">
 
 297       <xsl:call-template name="l10n.language"/>
 
 300     <xsl:apply-templates select="." mode="running.head.mode">
 
 301       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 302     </xsl:apply-templates>
 
 303     <xsl:apply-templates select="." mode="running.foot.mode">
 
 304       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 305     </xsl:apply-templates>
 
 306     <fo:flow flow-name="xsl-region-body">
 
 308         <xsl:call-template name="anchor">
 
 309           <xsl:with-param name="conditional" select="0"/>
 
 311         <xsl:call-template name="slides.titlepage"/>
 
 312         <xsl:apply-templates select="speakernotes"/>
 
 316   <xsl:apply-templates select="foil|foilgroup"/>
 
 319 <xsl:template match="slidesinfo"/>
 
 321 <xsl:template match="slides" mode="title.markup">
 
 322   <xsl:param name="allow-anchors" select="'0'"/>
 
 323   <xsl:apply-templates select="(slidesinfo/title|title)[1]"
 
 325     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
 
 326   </xsl:apply-templates>
 
 329 <!-- ============================================================ -->
 
 331 <xsl:template name="foilgroup.titlepage">
 
 332   <fo:block background-color="black"
 
 334             font-size="{$foil.title.size}"
 
 338             padding-bottom="12pt"
 
 340     <xsl:apply-templates select="title" mode="titlepage.mode"/>
 
 344 <xsl:template match="foilgroup">
 
 345   <xsl:variable name="master-reference">
 
 346     <xsl:call-template name="select.pagemaster"/>
 
 349   <fo:page-sequence hyphenate="{$hyphenate}"
 
 350                     master-reference="{$master-reference}">
 
 351     <xsl:call-template name="anchor">
 
 352       <xsl:with-param name="conditional" select="0"/>
 
 354     <xsl:attribute name="language">
 
 355       <xsl:call-template name="l10n.language"/>
 
 358     <xsl:apply-templates select="." mode="running.head.mode">
 
 359       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 360     </xsl:apply-templates>
 
 361     <xsl:apply-templates select="." mode="running.foot.mode">
 
 362       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 363     </xsl:apply-templates>
 
 365     <fo:flow flow-name="xsl-region-body">
 
 367         <xsl:if test="*[not(self::foil)]">
 
 368           <fo:block xsl:use-attribute-sets="foil.properties" space-after="1em">
 
 369             <xsl:apply-templates select="*[not(self::foil)]"/>
 
 373         <xsl:call-template name="foilgroup.titlepage"/>
 
 377   <xsl:apply-templates select="foil"/>
 
 380 <xsl:template match="foilgroup/title"/>
 
 381 <xsl:template match="foilgroup/titleabbrev"/>
 
 383 <xsl:template match="foilgroup/titleabbrev" mode="titlepage.mode">
 
 384   <xsl:apply-templates/>
 
 387 <xsl:template match="slides/foilgroup/title" mode="titlepage.mode">
 
 388   <xsl:apply-templates/>
 
 391 <xsl:template match="title" mode="foilgroup.titlepage.recto.mode">
 
 393     <fo:inline color="white">.</fo:inline>
 
 394     <fo:block space-before="2in">
 
 395       <xsl:apply-templates select="." mode="titlepage.mode"/>
 
 400 <xsl:template match="foilgroupinfo"/>
 
 402 <!-- ============================================================ -->
 
 405 <xsl:template name="foil.titlepage">
 
 406   <fo:block background-color="white"
 
 408             font-size="{$foil.title.size}"
 
 412             padding-bottom="12pt"
 
 414     <xsl:apply-templates select="title" mode="titlepage.mode"/>
 
 419 <xsl:template match="foil">
 
 420   <xsl:variable name="master-reference">
 
 421     <xsl:call-template name="select.pagemaster"/>
 
 424   <fo:page-sequence hyphenate="{$hyphenate}"
 
 425                     master-reference="{$master-reference}">
 
 426     <xsl:call-template name="anchor">
 
 427       <xsl:with-param name="conditional" select="0"/>
 
 429     <xsl:attribute name="language">
 
 430       <xsl:call-template name="l10n.language"/>
 
 433     <xsl:apply-templates select="." mode="running.head.mode">
 
 434       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 435     </xsl:apply-templates>
 
 436     <xsl:apply-templates select="." mode="running.foot.mode">
 
 437       <xsl:with-param name="master-reference" select="$master-reference"/>
 
 438     </xsl:apply-templates>
 
 439     <fo:flow flow-name="xsl-region-body">
 
 441         <fo:block xsl:use-attribute-sets="foil.properties">
 
 442           <xsl:apply-templates/>
 
 449 <xsl:template match="foilinfo"/>
 
 450 <xsl:template match="foil/title"/>
 
 451 <xsl:template match="foil/subtitle">
 
 452   <fo:block xsl:use-attribute-sets="foil.subtitle.properties">
 
 453     <xsl:apply-templates/>
 
 456 <xsl:template match="foil/titleabbrev"/>
 
 458 <!-- ============================================================ -->
 
 460 <xsl:template match="slides" mode="label.markup">
 
 461   <xsl:if test="@label">
 
 462     <xsl:value-of select="@label"/>
 
 466 <!-- ============================================================ -->
 
 468 <xsl:template match="speakernotes">
 
 469   <fo:block xsl:use-attribute-sets="speakernote.properties">
 
 470     <xsl:apply-templates/>
 
 474 <!-- ============================================================ -->
 
 479 <xsl:template match="slides|foilgroup|foil[not(@role) or @role != 'ENDTITLE']"
 
 481   <xsl:variable name="id">
 
 482     <xsl:call-template name="object.id"/>
 
 484   <xsl:variable name="bookmark-label">
 
 485     <xsl:apply-templates select="." mode="object.title.markup"/>
 
 488   <!-- Put the root element bookmark at the same level as its children -->
 
 489   <!-- If the object is a set or book, generate a bookmark for the toc -->
 
 492     <xsl:when test="parent::*">
 
 493       <rx:bookmark internal-destination="{$id}">
 
 495           <xsl:value-of select="$bookmark-label"/>
 
 497         <xsl:apply-templates select="*" mode="xep.outline"/>
 
 501       <xsl:if test="$bookmark-label != ''">
 
 502         <rx:bookmark internal-destination="{$id}">
 
 504             <xsl:value-of select="$bookmark-label"/>
 
 509       <xsl:apply-templates select="*" mode="xep.outline"/>
 
 514 <!-- Handling of xrefs -->
 
 516 <xsl:template match="foil|foilgroup" mode="xref-to">
 
 517   <xsl:param name="referrer"/>
 
 518   <xsl:param name="xrefstyle"/>
 
 520   <xsl:apply-templates select="." mode="object.xref.markup">
 
 521     <xsl:with-param name="purpose" select="'xref'"/>
 
 522     <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
 
 523     <xsl:with-param name="referrer" select="$referrer"/>
 
 524   </xsl:apply-templates>