]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix TOC processing for topic element.
authorBob Stayton <bobs@sagehill.net>
Thu, 19 Apr 2012 18:42:11 +0000 (18:42 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 19 Apr 2012 18:42:11 +0000 (18:42 +0000)
xsl/fo/autotoc.xsl
xsl/fo/component.xsl
xsl/fo/fop1.xsl
xsl/fo/titlepage.templates.xml
xsl/fo/xep.xsl

index e6aa1745497caba44da88364395dad3c1786121c..04e44060f0c8ba2f2a86e57c2b5826283656b947 100644 (file)
@@ -69,6 +69,7 @@
                         |$toc-context/chapter
                         |$toc-context/appendix
                         |$toc-context/article
+                        |$toc-context/topic
                         |$toc-context/bibliography
                         |$toc-context/glossary
                         |$toc-context/index"/>
   </xsl:variable>
 
   <xsl:variable name="nodes" select="section|sect1|refentry
-                                     |article|bibliography|glossary
+                                     |article|topic|bibliography|glossary
                                      |qandaset[$qanda.in.toc != 0]
                                      |appendix|index"/>
   <xsl:if test="$nodes">
   </xsl:call-template>
 
   <xsl:variable name="nodes" select="glossary|bibliography|preface|chapter
-                                     |reference|part|article|appendix|index"/>
+                                     |reference|part|article|topic|appendix|index"/>
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
   </xsl:call-template>
 
   <xsl:variable name="nodes" select="chapter|appendix|preface|reference|
-                                     refentry|article|index|glossary|
+                                     refentry|article|topic|index|glossary|
                                      bibliography"/>
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
   </xsl:if>
 </xsl:template>
 
-<xsl:template match="sect5|simplesect|topic" mode="toc">
+<xsl:template match="sect5|simplesect" mode="toc">
+  <xsl:param name="toc-context" select="."/>
+
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="topic" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
   <xsl:call-template name="toc.line">
index ed42ec99e0acdcf361b98482ae048d8358d22028..3a066326fb20469d8076afde3a9cf140b03599e9 100644 (file)
   <xsl:variable name="master-reference">
     <xsl:call-template name="select.pagemaster"/>
   </xsl:variable>
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
 
   <xsl:apply-templates select="." mode="page.sequence">
-    <xsl:with-param name="master-reference"
-                    select="$master-reference"/>
-  </xsl:apply-templates> 
+    <xsl:with-param name="master-reference" select="$master-reference"/>
+    <xsl:with-param name="content">
+      <xsl:element name="fo:{$section.container.element}">
+        <xsl:attribute name="id"><xsl:value-of 
+                            select="$id"/></xsl:attribute>
+        <xsl:call-template name="topic.titlepage"/>
+    
+        <xsl:apply-templates/>
+
+      </xsl:element>
+    </xsl:with-param>
+  </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="topic/info"></xsl:template>
index 46d18b9482b475b4022f2602379799a8f0e6cf93..9cea9ce84f73117e8e999c1c1f37fc344f7fac8f 100644 (file)
@@ -28,7 +28,7 @@
 </xsl:template>
 
 <xsl:template match="set|book|part|reference|
-                     preface|chapter|appendix|article
+                     preface|chapter|appendix|article|topic
                      |glossary|bibliography|index|setindex
                      |refentry
                      |sect1|sect2|sect3|sect4|sect5|section"
@@ -74,7 +74,7 @@
       </xsl:variable>
 
       <xsl:if test="contains($toc.params, 'toc')
-                    and (book|part|reference|preface|chapter|appendix|article
+                    and (book|part|reference|preface|chapter|appendix|article|topic
                          |glossary|bibliography|index|setindex
                          |refentry
                          |sect1|sect2|sect3|sect4|sect5|section)">
@@ -99,7 +99,7 @@
 </xsl:template>
 
 <xsl:template match="set|book|part|reference|
-                     preface|chapter|appendix|article
+                     preface|chapter|appendix|article|topic
                      |glossary|bibliography|index|setindex
                      |refentry
                      |sect1|sect2|sect3|sect4|sect5|section"
index 9dd7e1cc529d02acaac4a8a1a6fdbe11e4c6131a..4e283c5967251452524ad5243942adc8567372d0 100644 (file)
 <t:titlepage t:element="topic" t:wrapper="fo:block">
   <t:titlepage-content t:side="recto">
     <title
+          t:force="1"
+          t:named-template="component.title"
+          param:node="ancestor-or-self::topic[1]"
           margin-left="{$title.margin.left}"
           font-family="{$title.fontset}"/>
     <subtitle
index 4e89d4219c9ede94c265502a8bc8af63656d3800..782ab378e7f3cf466ed695b6ad1e34204c73fc1d 100644 (file)
 </xsl:template>
 
 <xsl:template match="set|book|part|reference|preface|chapter|appendix|article
-                     |glossary|bibliography|index|setindex
+                     |glossary|bibliography|index|setindex|topic
                      |refentry|refsynopsisdiv
                      |refsect1|refsect2|refsect3|refsection
                      |sect1|sect2|sect3|sect4|sect5|section"
       </xsl:variable>
       <xsl:if test="contains($toc.params, 'toc')
                     and set|book|part|reference|section|sect1|refentry
-                        |article|bibliography|glossary|chapter
+                        |article|topic|bibliography|glossary|chapter
                         |appendix">
         <rx:bookmark internal-destination="toc...{$id}">
           <rx:bookmark-label>