]> granicus.if.org Git - docbook-dsssl/commitdiff
Support titleabbrev for running headers/footers; don't force a section ToC for refentrys
authorNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 18:41:39 +0000 (18:41 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 18:41:39 +0000 (18:41 +0000)
xsl/fo/sections.xsl

index 4df1f32562801f9152a22d611ccea4269e6512f4..41f9dc50516924fffcdce9e07639aedf88096851 100644 (file)
@@ -29,9 +29,8 @@
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and (count(ancestor::section)+1) &lt;= $generate.section.toc.level)
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                  and (count(ancestor::section)+1) &lt;= $generate.section.toc.level">
       <xsl:call-template name="section.toc">
         <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
       </xsl:call-template>
@@ -81,9 +80,8 @@
         </xsl:call-template>
       </xsl:variable>
 
-      <xsl:if test="(contains($toc.params, 'toc')
-                     and (count(ancestor::section)+1) &lt;= $generate.section.toc.level)
-                    or refentry">
+      <xsl:if test="contains($toc.params, 'toc')
+                    and (count(ancestor::section)+1) &lt;= $generate.section.toc.level">
         <xsl:call-template name="section.toc"/>
         <xsl:call-template name="section.toc.separator"/>
       </xsl:if>
       </xsl:apply-templates>
     </xsl:variable>
 
+    <xsl:variable name="titleabbrev">
+      <xsl:apply-templates select="$section" mode="titleabbrev.markup"/>
+    </xsl:variable>
+
     <xsl:if test="$passivetex.extensions != 0">
       <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" 
                       fotex-bookmark-level="{$level + 2}" 
                       fotex-bookmark-label="{$id}">
-        <xsl:value-of select="$title"/>
+        <xsl:value-of select="$titleabbrev"/>
       </fotex:bookmark>
     </xsl:if>
 
     <xsl:call-template name="section.heading">
       <xsl:with-param name="level" select="$level"/>
       <xsl:with-param name="title" select="$title"/>
+      <xsl:with-param name="titleabbrev" select="$titleabbrev"/>
     </xsl:call-template>
   </fo:block>
 </xsl:template>
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and ($generate.section.toc.level &gt;= 1))
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 1">
       <xsl:call-template name="section.toc"/>
       <xsl:call-template name="section.toc.separator"/>
     </xsl:if>
         </xsl:call-template>
       </xsl:variable>
 
-      <xsl:if test="(contains($toc.params, 'toc')
-                     and ($generate.section.toc.level &gt;= 1))
-                    or refentry">
+      <xsl:if test="contains($toc.params, 'toc')
+                    and $generate.section.toc.level &gt;= 1">
         <xsl:call-template name="section.toc"/>
         <xsl:call-template name="section.toc.separator"/>
       </xsl:if>
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and ($generate.section.toc.level &gt;= 2))
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                   and $generate.section.toc.level &gt;= 2">
       <xsl:call-template name="section.toc"/>
       <xsl:call-template name="section.toc.separator"/>
     </xsl:if>
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and ($generate.section.toc.level &gt;= 3))
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 3">
       <xsl:call-template name="section.toc"/>
       <xsl:call-template name="section.toc.separator"/>
     </xsl:if>
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and ($generate.section.toc.level &gt;= 4))
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 4">
       <xsl:call-template name="section.toc"/>
       <xsl:call-template name="section.toc.separator"/>
     </xsl:if>
       </xsl:call-template>
     </xsl:variable>
 
-    <xsl:if test="(contains($toc.params, 'toc')
-                   and ($generate.section.toc.level &gt;= 5))
-                  or refentry">
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 5">
       <xsl:call-template name="section.toc"/>
       <xsl:call-template name="section.toc.separator"/>
     </xsl:if>
 
 <xsl:template name="section.heading">
   <xsl:param name="level" select="1"/>
+  <xsl:param name="marker" select="1"/>
   <xsl:param name="title"/>
+  <xsl:param name="titleabbrev"/>
 
   <fo:block xsl:use-attribute-sets="section.title.properties">
-    <fo:marker marker-class-name="section.head.marker">
-      <xsl:value-of select="$title"/>
-    </fo:marker>
+    <xsl:if test="$marker != 0">
+      <fo:marker marker-class-name="section.head.marker">
+        <xsl:choose>
+          <xsl:when test="$titleabbrev = ''">
+            <xsl:value-of select="$title"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$titleabbrev"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:marker>
+    </xsl:if>
     <xsl:choose>
       <xsl:when test="$level=1">
         <fo:block xsl:use-attribute-sets="section.title.level1.properties">