]> granicus.if.org Git - docbook-dsssl/commitdiff
Added code to handle acknowledgements in book and part. The element is processed
authorMauritz Jeanson <mj@johanneberg.com>
Thu, 12 Mar 2009 17:43:44 +0000 (17:43 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Thu, 12 Mar 2009 17:43:44 +0000 (17:43 +0000)
similarly to dedication. All acknowledgements will appear as front matter, after
any dedications.

xsl/fo/component.xsl
xsl/fo/division.xsl
xsl/fo/pagesetup.xsl
xsl/fo/titlepage.templates.xml
xsl/fo/titlepage.xsl
xsl/fo/xref.xsl

index 32d4cdd1ca669f8a24b92b434ab73c467f022aff..bd0df773ee590a4a45e8c3093938c21c6bd1b2fa 100644 (file)
 
 <!-- ==================================================================== -->
 
+<xsl:template match="acknowledgements" mode="acknowledgements">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <fo:page-sequence hyphenate="{$hyphenate}"
+                    master-reference="{$master-reference}">
+    <xsl:attribute name="language">
+      <xsl:call-template name="l10n.language"/>
+    </xsl:attribute>
+    <xsl:attribute name="format">
+      <xsl:call-template name="page.number.format">
+        <xsl:with-param name="master-reference" select="$master-reference"/>
+      </xsl:call-template>
+    </xsl:attribute>
+    <xsl:attribute name="initial-page-number">
+      <xsl:call-template name="initial.page.number">
+        <xsl:with-param name="master-reference" select="$master-reference"/>
+      </xsl:call-template>
+    </xsl:attribute>
+    <xsl:attribute name="force-page-count">
+      <xsl:call-template name="force.page.count">
+        <xsl:with-param name="master-reference" select="$master-reference"/>
+      </xsl:call-template>
+    </xsl:attribute>
+    <xsl:attribute name="hyphenation-character">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'hyphenation-character'"/>
+      </xsl:call-template>
+    </xsl:attribute>
+    <xsl:attribute name="hyphenation-push-character-count">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
+      </xsl:call-template>
+    </xsl:attribute>
+    <xsl:attribute name="hyphenation-remain-character-count">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
+      </xsl:call-template>
+    </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">
+      <xsl:call-template name="set.flow.properties">
+        <xsl:with-param name="element" select="local-name(.)"/>
+        <xsl:with-param name="master-reference" select="$master-reference"/>
+      </xsl:call-template>
+
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="acknowledgements.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="acknowledgements"></xsl:template>
+<xsl:template match="acknowledgements/info"></xsl:template>
+<xsl:template match="acknowledgements/title"></xsl:template>
+<xsl:template match="acknowledgements/titleabbrev"></xsl:template>
+<xsl:template match="acknowledgements/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
 <xsl:template match="colophon">
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>
index 4249248cb8fe23a0d6e913de38452c4f513d7107..88002c60bf0b98548400618ed2c341ef40bec865 100644 (file)
   </xsl:if>
 
   <xsl:apply-templates select="dedication" mode="dedication"/>
+  <xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
 
   <xsl:call-template name="make.book.tocs"/>
 
index ec93415152aa3c1484d21f25dcf467d8c474bb79..402f0d70b04b36b176c90f132bb865018ee87826 100644 (file)
       </xsl:when>
       <xsl:when test="$pageclass = 'lot'">lot</xsl:when>
       <xsl:when test="$element = 'dedication'">front</xsl:when>
+      <xsl:when test="$element = 'acknowledgements'">front</xsl:when>
       <xsl:when test="$element = 'preface'">front</xsl:when>
       <xsl:when test="$element = 'appendix'">back</xsl:when>
       <xsl:when test="$element = 'glossary'">back</xsl:when>
index 761422d28053ae5759f1f430de9f90928e39f62c..454c8771417aa9882ae2b0a32c07f26e736555f4 100644 (file)
   </t:titlepage-before>
 </t:titlepage>
 
+<!-- ==================================================================== -->
+
+<!-- Same formatting as dedication -->
+ <t:titlepage t:element="acknowledgements" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+            t:force="1"
+            t:named-template="component.title"
+            param:node="ancestor-or-self::acknowledgements[1]"
+            margin-left="{$title.margin.left}"
+            font-size="&hsize5;"
+            font-family="{$title.fontset}"
+            font-weight="bold"/>
+      <subtitle
+               font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+
 <!-- ==================================================================== -->
 
   <t:titlepage t:element="preface" t:wrapper="fo:block">
index 2dcf318895e288b3c96de17a46f8a48a2df526b8..9e1223cc22c04ba251c9f46c54aba2370200b220 100644 (file)
@@ -49,6 +49,9 @@
 <xsl:attribute-set name="dedication.titlepage.recto.style"/>
 <xsl:attribute-set name="dedication.titlepage.verso.style"/>
 
+<xsl:attribute-set name="acknowledgements.titlepage.recto.style"/>
+<xsl:attribute-set name="acknowledgements.titlepage.verso.style"/>
+
 <xsl:attribute-set name="preface.titlepage.recto.style"/>
 <xsl:attribute-set name="preface.titlepage.verso.style"/>
 
index 7465768421785b9396765399a346b0053d62ac89..a7a70bb810731f6ce00d00290028382ebb4c85cf 100644 (file)
   <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
 </xsl:template>
 
-<xsl:template match="dedication|preface|chapter|appendix" mode="xref-to">
+<xsl:template match="dedication|acknowledgements|preface|chapter|appendix" mode="xref-to">
   <xsl:param name="referrer"/>
   <xsl:param name="xrefstyle"/>
   <xsl:param name="verbose" select="1"/>
                                        |ancestor::preface
                                        |ancestor::partintro
                                        |ancestor::dedication
+                                       |ancestor::acknowledgements
                                        |ancestor::colophon
                                        |ancestor::bibliography
                                        |ancestor::index
                     or local-name($target) = 'equation'
                     or local-name($target) = 'table'
                     or local-name($target) = 'dedication'
+                    or local-name($target) = 'acknowledgements'
                     or local-name($target) = 'preface'
                     or local-name($target) = 'bibliography'
                     or local-name($target) = 'glossary'