]> granicus.if.org Git - docbook-dsssl/commitdiff
Reworked so that it's actually reasonably decent
authorNorman Walsh <ndw@nwalsh.com>
Thu, 16 Jan 2003 00:30:09 +0000 (00:30 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 16 Jan 2003 00:30:09 +0000 (00:30 +0000)
slides/xsl/fo/plain-titlepage.xml
slides/xsl/fo/plain.xsl

index d40d8c8ca0e9b0790bf47c74747fe2d8a08e56fd..ac8c960e33655e2a4f8530d6ea9b607577eb6498 100644 (file)
@@ -26,8 +26,9 @@
             param:node="ancestor-or-self::slides[1]"
             fo:text-align="center"
             fo:space-after="1em"
+             fo:padding-top="1.5in"
             fo:keep-with-next="always"
-            fo:font-size="24pt"
+            fo:font-size="{$foil.title.size}"
             fo:font-weight="bold"
             fo:font-family="{$slide.title.font.family}"/>
 
   </t:titlepage-before>
 </t:titlepage>
 
-<!-- ==================================================================== -->
-
-<t:titlepage element="foilgroup" wrapper="fo:block">
-  <t:titlepage-content side="recto">
-    <title predicate="[1]"
-          fo:font-size="24pt"
-          fo:text-align="center"
-          fo:font-weight="bold"
-          fo:font-family="{$slide.title.font.family}"/>
-    <subtitle predicate="[1]"
-             fo:font-family="{$slide.title.font.family}"/>
-    <corpauthor/>
-    <authorgroup/>
-    <author/>
-    <releaseinfo/>
-    <copyright/>
-    <legalnotice/>
-    <pubdate/>
-    <revision/>
-    <revhistory/>
-    <abstract/>
-  </t:titlepage-content>
-
-  <t:titlepage-content side="verso">
-  </t:titlepage-content>
-
-  <t:titlepage-separator>
-  </t:titlepage-separator>
-
-  <t:titlepage-before side="recto">
-  </t:titlepage-before>
-
-  <t:titlepage-before side="verso">
-  </t:titlepage-before>
-</t:titlepage>
-
-<!-- ==================================================================== -->
-
-<t:titlepage element="foil" wrapper="fo:block">
-  <t:titlepage-content side="recto">
-    <title predicate="[1]"
-          fo:font-size="22pt"
-          fo:font-weight="bold"
-          fo:text-align="center"
-          fo:font-family="{$slide.title.font.family}"/>
-    <subtitle predicate="[1]"
-             fo:font-family="{$slide.title.font.family}"/>
-    <corpauthor/>
-    <authorgroup/>
-    <author/>
-    <releaseinfo/>
-    <copyright/>
-    <legalnotice/>
-    <pubdate/>
-    <revision/>
-    <revhistory/>
-    <abstract/>
-  </t:titlepage-content>
-
-  <t:titlepage-content side="verso">
-  </t:titlepage-content>
-
-  <t:titlepage-separator>
-  </t:titlepage-separator>
-
-  <t:titlepage-before side="recto">
-  </t:titlepage-before>
-
-  <t:titlepage-before side="verso">
-  </t:titlepage-before>
-</t:titlepage>
-
-<!-- ==================================================================== -->
-
 </t:templates>
index b131266c29773617675298578b1430400fc78dc2..dbc530b3d42abdb70208b42f64a33745c99b8268 100644 (file)
@@ -1,14 +1,16 @@
 <?xml version="1.0"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:rx="http://www.renderx.com/XSL/Extensions"
                 version="1.0">
 
 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
-<xsl:include href="titlepage-fo-plain.xsl"/>
+<xsl:include href="plain-titlepage.xsl"/>
 
 <xsl:param name="local.l10n.xml" select="document('')"/>
 <i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
   <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
+    <l:gentext key="Continued" text="(Continued)"/>
     <l:context name="title">
       <l:template name="slides" text="%t"/>
       <l:template name="foilgroup" text="%t"/>
   </l:l10n>
 </i18n>
 
+<xsl:param name="preferred.mediaobject.role" select="'print'"/>
+
 <xsl:param name="page.orientation" select="'landscape'"/>
 
 <xsl:param name="slide.title.font.family" select="'Helvetica'"/>
 <xsl:param name="slide.font.family" select="'Helvetica'"/>
 
-<xsl:param name="body.font.master" select="18"/>
+<xsl:param name="body.font.master" select="24"/>
+
+<xsl:param name="foil.title.master" select="36"/>
+<xsl:param name="foil.title.size">
+ <xsl:value-of select="$foil.title.master"/><xsl:text>pt</xsl:text>
+</xsl:param>
 
 <xsl:attribute-set name="slides.properties">
   <xsl:attribute name="font-family">
   <xsl:attribute name="font-family">
     <xsl:value-of select="$slide.font.family"/>
   </xsl:attribute>
-  <xsl:attribute name="font-size">18pt</xsl:attribute>
+  <xsl:attribute name="margin-left">1in</xsl:attribute>
+  <xsl:attribute name="margin-right">1in</xsl:attribute>
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.size"/>
+  </xsl:attribute>
   <xsl:attribute name="font-weight">bold</xsl:attribute>
 </xsl:attribute-set>
 
+<xsl:attribute-set name="formal.title.properties"
+                   use-attribute-sets="normal.para.spacing">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.2"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">8pt</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">6pt</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">10pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="list.block.spacing">
+  <xsl:attribute name="space-before.optimum">12pt</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">8pt</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">14pt</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="list.item.spacing">
+  <xsl:attribute name="space-before.optimum">6pt</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">4pt</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">8pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="normal.para.spacing">
+  <xsl:attribute name="space-before.optimum">8pt</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">6pt</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">10pt</xsl:attribute>
+</xsl:attribute-set>
+
 <xsl:attribute-set name="speakernote.properties">
   <xsl:attribute name="font-family">Times Roman</xsl:attribute>
   <xsl:attribute name="font-style">italic</xsl:attribute>
   <xsl:attribute name="font-weight">normal</xsl:attribute>
 </xsl:attribute-set>
 
-<xsl:attribute-set name="slides.titlepage.recto.style"/>
-<xsl:attribute-set name="slides.titlepage.verso.style"/>
-<xsl:attribute-set name="foilgroup.titlepage.recto.style"/>
-<xsl:attribute-set name="foilgroup.titlepage.verso.style"/>
-<xsl:attribute-set name="foil.titlepage.recto.style"/>
-<xsl:attribute-set name="foil.titlepage.verso.style"/>
+<xsl:attribute-set name="slides.titlepage.recto.style">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$slide.font.family"/>
+  </xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="slides.titlepage.verso.style">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$slide.font.family"/>
+  </xsl:attribute>
+</xsl:attribute-set>
 
 <!-- ============================================================ -->
 
-<xsl:template name="user.pagemasters">
-  <fo:page-sequence-master master-name="twoside1-with-titlepage">
-    <fo:repeatable-page-master-alternatives>
-      <fo:conditional-page-master-reference master-reference="titlepage-first"
-                                            page-position="first"/>
-      <fo:conditional-page-master-reference master-reference="blank"
-                                            blank-or-not-blank="blank"/>
-      <fo:conditional-page-master-reference master-reference="body-odd"
-                                            odd-or-even="odd"/>
-      <fo:conditional-page-master-reference master-reference="body-even"
-                                            odd-or-even="even"/>
-    </fo:repeatable-page-master-alternatives>
-  </fo:page-sequence-master>
+<xsl:param name="page.margin.top" select="'0.25in'"/>
+<xsl:param name="region.before.extent" select="'0.75in'"/>
+<xsl:param name="body.margin.top" select="'1in'"/>
+
+<xsl:param name="region.after.extent" select="'0.5in'"/>
+<xsl:param name="body.margin.bottom" select="'0.5in'"/>
+<xsl:param name="page.margin.bottom" select="'0.25in'"/>
 
-  <fo:page-sequence-master master-name="oneside1-with-titlepage">
+<xsl:param name="page.margin.inner" select="'0.25in'"/>
+<xsl:param name="page.margin.outer" select="'0.25in'"/>
+<xsl:param name="column.count.body" select="1"/>
+
+<xsl:template name="user.pagemasters">
+  <fo:simple-page-master master-name="slides-titlepage-master"
+                         page-width="{$page.width}"
+                         page-height="{$page.height}"
+                         margin-top="{$page.margin.top}"
+                         margin-bottom="{$page.margin.bottom}"
+                         margin-left="{$page.margin.inner}"
+                         margin-right="{$page.margin.outer}">
+    <fo:region-body margin-bottom="0pt"
+                    margin-top="0pt"
+                    column-count="{$column.count.body}">
+    </fo:region-body>
+  </fo:simple-page-master>
+
+  <fo:simple-page-master master-name="slides-foil-master"
+                         page-width="{$page.width}"
+                         page-height="{$page.height}"
+                         margin-top="{$page.margin.top}"
+                         margin-bottom="{$page.margin.bottom}"
+                         margin-left="{$page.margin.inner}"
+                         margin-right="{$page.margin.outer}">
+    <fo:region-body margin-bottom="{$body.margin.bottom}"
+                    margin-top="{$body.margin.top}"
+                    column-count="{$column.count.body}">
+    </fo:region-body>
+    <fo:region-before region-name="xsl-region-before-foil"
+                      extent="{$region.before.extent}"
+                      display-align="before"/>
+    <fo:region-after region-name="xsl-region-after-foil"
+                     extent="{$region.after.extent}"
+                     display-align="after"/>
+  </fo:simple-page-master>
+
+  <fo:simple-page-master master-name="slides-foil-continued-master"
+                         page-width="{$page.width}"
+                         page-height="{$page.height}"
+                         margin-top="{$page.margin.top}"
+                         margin-bottom="{$page.margin.bottom}"
+                         margin-left="{$page.margin.inner}"
+                         margin-right="{$page.margin.outer}">
+    <fo:region-body margin-bottom="{$body.margin.bottom}"
+                    margin-top="{$body.margin.top}"
+                    column-count="{$column.count.body}">
+    </fo:region-body>
+    <fo:region-before region-name="xsl-region-before-foil-continued"
+                      extent="{$region.before.extent}"
+                      display-align="before"/>
+    <fo:region-after region-name="xsl-region-after-foil-continued"
+                     extent="{$region.after.extent}"
+                     display-align="after"/>
+  </fo:simple-page-master>
+
+  <fo:page-sequence-master master-name="slides-titlepage">
     <fo:repeatable-page-master-alternatives>
-      <fo:conditional-page-master-reference master-reference="titlepage-first"
-                                            page-position="first"/>
-      <fo:conditional-page-master-reference master-reference="body-odd"/>
+      <fo:conditional-page-master-reference master-reference="slides-titlepage-master"/>
     </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
 
-  <fo:page-sequence-master master-name="titlepage1">
+  <fo:page-sequence-master master-name="slides-foil">
     <fo:repeatable-page-master-alternatives>
-      <fo:conditional-page-master-reference master-reference="titlepage-first"
+      <fo:conditional-page-master-reference master-reference="slides-foil-master"
                                             page-position="first"/>
-      <fo:conditional-page-master-reference master-reference="body-odd"/>
+      <fo:conditional-page-master-reference master-reference="slides-foil-continued-master"/>
     </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
 </xsl:template>
 <xsl:template match="*" mode="running.head.mode">
   <xsl:param name="master-reference" select="'unknown'"/>
   <!-- use the foilgroup title if there is one -->
-  <fo:static-content flow-name="xsl-region-before">
-    <fo:block text-align="center" font-size="14pt">
-      <xsl:apply-templates select="ancestor-or-self::foilgroup"
-                           mode="object.title.markup"/>
+  <fo:static-content flow-name="xsl-region-before-foil">
+    <fo:block background-color="white"
+              color="black"
+              font-size="{$foil.title.size}"
+              font-weight="bold"
+              text-align="center"
+              font-family="{$slide.title.font.family}">
+      <xsl:apply-templates select="title" mode="titlepage.mode"/>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-before-foil-continued">
+    <fo:block background-color="white"
+              color="black"
+              font-size="{$foil.title.size}"
+              font-weight="bold"
+              text-align="center"
+              font-family="{$slide.title.font.family}">
+      <xsl:apply-templates select="title" mode="titlepage.mode"/>
+      <xsl:text> </xsl:text>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Continued'"/>
+      </xsl:call-template>
     </fo:block>
   </fo:static-content>
 </xsl:template>
 
 <xsl:template match="*" mode="running.foot.mode">
   <xsl:param name="master-reference" select="'unknown'"/>
-  <xsl:variable name="foot">
-    <fo:page-number/>
+
+  <xsl:variable name="last-slide"
+                select="(//foil|//foilgroup)[last()]"/>
+
+  <xsl:variable name="last-id">
+    <xsl:choose>
+      <xsl:when test="$last-slide/@id">
+        <xsl:value-of select="$last-slide/@id"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="generate-id($last-slide)"/>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:variable>
-  <!-- by default, the page number -->
-  <xsl:choose>
-    <xsl:when test="$master-reference='titlepage1'"></xsl:when>
-    <xsl:when test="$master-reference='oneside1-with-titlepage'">
-      <fo:static-content flow-name="xsl-region-after">
-        <fo:block text-align="center" font-size="14pt">
-          <xsl:copy-of select="$foot"/>
-        </fo:block>
-      </fo:static-content>
-    </xsl:when>
-    <xsl:when test="$master-reference='twoside1-with-titlepage'">
-      <fo:static-content flow-name="xsl-region-after-left">
-        <fo:block text-align="left" font-size="14pt">
-          <xsl:copy-of select="$foot"/>
-        </fo:block>
-      </fo:static-content>
-      <fo:static-content flow-name="xsl-region-after-right">
-        <fo:block text-align="right" font-size="14pt">
-          <xsl:copy-of select="$foot"/>
-        </fo:block>
-      </fo:static-content>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:message>
-        <xsl:text>Unexpected master-reference (</xsl:text>
-        <xsl:value-of select="$master-reference"/>
-        <xsl:text>) in running.foot.mode for </xsl:text>
-        <xsl:value-of select="name(.)"/>
-        <xsl:text>. No footer generated.</xsl:text>
-      </xsl:message>
-    </xsl:otherwise>
-  </xsl:choose>
+
+  <xsl:variable name="content">
+    <fo:table table-layout="fixed" width="100%"
+              font-family="{$slide.font.family}"
+              font-size="14pt"
+              color="#9F9F9F">
+      <fo:table-column column-number="1" column-width="33%"/>
+      <fo:table-column column-number="2" column-width="34%"/>
+      <fo:table-column column-number="3" column-width="33%"/>
+      <fo:table-body>
+        <fo:table-row height="14pt">
+          <fo:table-cell text-align="left">
+            <fo:block>
+              <xsl:if test="self::foil">
+                <xsl:choose>
+                  <xsl:when test="ancestor::foilgroup[1]/titleabbrev">
+                    <xsl:apply-templates select="ancestor::foilgroup[1]/titleabbrev"
+                                         mode="titlepage.mode"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="ancestor::foilgroup[1]/title"
+                                         mode="titlepage.mode"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:if>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="center">
+            <fo:block>
+              <xsl:if test="/slides/slidesinfo/releaseinfo[@role='copyright']">
+                <xsl:apply-templates select="/slides/slidesinfo/releaseinfo[@role='copyright']"
+                                     mode="value"/>
+                <xsl:text>&#160;&#160;&#160;</xsl:text>
+              </xsl:if>
+              <xsl:apply-templates select="/slides/slidesinfo/copyright"
+                                   mode="titlepage.mode"/>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="right">
+            <fo:block>
+              <fo:page-number/>
+              <xsl:text>&#160;/&#160;</xsl:text>
+              <fo:page-number-citation ref-id="{$last-id}"/>
+            </fo:block>
+          </fo:table-cell>
+        </fo:table-row>
+      </fo:table-body>
+    </fo:table>
+  </xsl:variable>
+
+  <fo:static-content flow-name="xsl-region-after-foil">
+    <fo:block>
+      <xsl:copy-of select="$content"/>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-after-foil-continued">
+    <fo:block>
+      <xsl:copy-of select="$content"/>
+    </fo:block>
+  </fo:static-content>
 </xsl:template>
 
 <xsl:template name="select.user.pagemaster">
   <xsl:param name="default-pagemaster"/>
 
   <xsl:choose>
-    <xsl:when test="$element = 'slides'">titlepage1</xsl:when>
-    <xsl:when test="$double.sided != 0">twoside1-with-titlepage</xsl:when>
-    <xsl:otherwise>oneside1-with-titlepage</xsl:otherwise>
+    <xsl:when test="$element = 'slides'">slides-titlepage</xsl:when>
+    <xsl:otherwise>slides-foil</xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
     <xsl:apply-templates select="." mode="running.foot.mode">
       <xsl:with-param name="master-reference" select="$master-reference"/>
     </xsl:apply-templates>
-    <fo:flow flow-name="xsl-region-body"
-             xsl:use-attribute-sets="slides.properties">
-      <xsl:call-template name="slides.titlepage"/>
-      <xsl:apply-templates select="speakernotes"/>
-      <xsl:apply-templates select="foil"/>
+    <fo:flow flow-name="xsl-region-body">
+      <fo:block>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+        </xsl:call-template>
+        <xsl:call-template name="slides.titlepage"/>
+        <xsl:apply-templates select="speakernotes"/>
+      </fo:block>
     </fo:flow>
   </fo:page-sequence>
-  <xsl:apply-templates select="foilgroup"/>
+  <xsl:apply-templates select="foil|foilgroup"/>
 </xsl:template>
 
 <xsl:template match="slidesinfo"/>
 
 <!-- ============================================================ -->
 
+<xsl:template name="foilgroup.titlepage">
+  <fo:block background-color="black"
+            color="white"
+            font-size="{$foil.title.size}"
+            font-weight="bold"
+            text-align="center"
+            padding-top="12pt"
+            padding-bottom="12pt"
+            space-after="1em">
+    <xsl:apply-templates select="title" mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
 <xsl:template match="foilgroup">
   <xsl:variable name="master-reference">
     <xsl:call-template name="select.pagemaster"/>
 
   <fo:page-sequence hyphenate="{$hyphenate}"
                     master-reference="{$master-reference}">
+    <xsl:call-template name="anchor">
+      <xsl:with-param name="conditional" select="0"/>
+    </xsl:call-template>
     <xsl:attribute name="language">
       <xsl:call-template name="l10n.language"/>
     </xsl:attribute>
     <xsl:apply-templates select="." mode="running.foot.mode">
       <xsl:with-param name="master-reference" select="$master-reference"/>
     </xsl:apply-templates>
-    <fo:flow flow-name="xsl-region-body"
-             xsl:use-attribute-sets="foilgroup.properties">
-      <xsl:call-template name="foilgroup.titlepage"/>
-      <xsl:apply-templates select="speakernotes"/>
-      <xsl:apply-templates select="foil"/>
+
+    <fo:flow flow-name="xsl-region-body">
+      <fo:block>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+        </xsl:call-template>
+        <fo:block xsl:use-attribute-sets="foil.properties">
+          <xsl:apply-templates select="*[not(self::foil)]"/>
+        </fo:block>
+      </fo:block>
     </fo:flow>
   </fo:page-sequence>
+  <xsl:apply-templates select="foil"/>
 </xsl:template>
 
-<xsl:template match="foilgroup/title">
-  <!-- suppress -->
+<xsl:template match="foilgroup/title"/>
+<xsl:template match="foilgroup/titleabbrev"/>
+
+<xsl:template match="foilgroup/titleabbrev" mode="titlepage.mode">
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="slides/foilgroup/title" mode="titlepage.mode">
 
 <!-- ============================================================ -->
 
+<!--
+<xsl:template name="foil.titlepage">
+  <fo:block background-color="white"
+            color="black"
+            font-size="{$foil.title.size}"
+            font-weight="bold"
+            text-align="center"
+            padding-top="12pt"
+            padding-bottom="12pt"
+            space-after="1em">
+    <xsl:apply-templates select="title" mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+-->
+
 <xsl:template match="foil">
-  <fo:block break-before="page"
-            xsl:use-attribute-sets="foil.properties">
-    <xsl:call-template name="foil.titlepage"/>
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
 
-    <fo:block xsl:use-attribute-sets="foil.properties">
-      <xsl:apply-templates/>
-    </fo:block>
-  </fo:block>
+  <fo:page-sequence hyphenate="{$hyphenate}"
+                    master-reference="{$master-reference}">
+    <xsl:call-template name="anchor">
+      <xsl:with-param name="conditional" select="0"/>
+    </xsl:call-template>
+    <xsl:attribute name="language">
+      <xsl:call-template name="l10n.language"/>
+    </xsl:attribute>
+
+    <xsl:apply-templates select="." mode="running.head.mode">
+      <xsl:with-param name="master-reference" select="$master-reference"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="." mode="running.foot.mode">
+      <xsl:with-param name="master-reference" select="$master-reference"/>
+    </xsl:apply-templates>
+    <fo:flow flow-name="xsl-region-body">
+      <fo:block>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+        </xsl:call-template>
+
+        <fo:block xsl:use-attribute-sets="foil.properties">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
 </xsl:template>
 
 <xsl:template match="foilinfo"/>
 
 <!-- ============================================================ -->
 
+<xsl:template match="slides" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- ============================================================ -->
+
 <xsl:template match="speakernotes">
   <fo:block xsl:use-attribute-sets="speakernote.properties">
     <xsl:apply-templates/>
 </xsl:template>
 
 <!-- ============================================================ -->
+<!-- Bookmarks -->
+
+<!-- XEP -->
+
+<xsl:template match="slides|foilgroup|foil[not(@role) or @role != 'ENDTITLE']"
+              mode="xep.outline">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <xsl:variable name="bookmark-label">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+
+  <!-- Put the root element bookmark at the same level as its children -->
+  <!-- If the object is a set or book, generate a bookmark for the toc -->
+
+  <xsl:choose>
+    <xsl:when test="parent::*">
+      <rx:bookmark internal-destination="{$id}">
+        <rx:bookmark-label>
+          <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
+        </rx:bookmark-label>
+        <xsl:apply-templates select="*" mode="xep.outline"/>
+      </rx:bookmark>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$bookmark-label != ''">
+        <rx:bookmark internal-destination="{$id}">
+          <rx:bookmark-label>
+            <xsl:value-of select="translate($bookmark-label, $a-dia, $a-asc)"/>
+          </rx:bookmark-label>
+        </rx:bookmark>
+      </xsl:if>
+
+      <xsl:apply-templates select="*" mode="xep.outline"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
 
 </xsl:stylesheet>