]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #596599: TOC for article/appendix in chunked HTML
authorNorman Walsh <ndw@nwalsh.com>
Fri, 27 Sep 2002 12:46:35 +0000 (12:46 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 27 Sep 2002 12:46:35 +0000 (12:46 +0000)
xsl/html/component.xsl

index 54ac060a49fea5540dae0f685b236754ad310622..101a6b99bc1586f8eedaff8039c2536409e00afd 100644 (file)
 <!-- ==================================================================== -->
 
 <xsl:template match="appendix">
-  <div class="{name(.)}">
-    <xsl:if test="$generate.id.attributes != 0">
-      <xsl:attribute name="id">
-        <xsl:call-template name="object.id"/>
-      </xsl:attribute>
-    </xsl:if>
-
-    <xsl:call-template name="component.separator"/>
-    <xsl:call-template name="appendix.titlepage"/>
-
-    <xsl:variable name="toc.params">
-      <xsl:call-template name="find.path.params">
-        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
-      </xsl:call-template>
-    </xsl:variable>
-    <xsl:if test="contains($toc.params, 'toc')">
-      <xsl:call-template name="component.toc"/>
-    </xsl:if>
-    <xsl:apply-templates/>
-    <xsl:call-template name="process.footnotes"/>
-  </div>
-</xsl:template>
+  <xsl:variable name="ischunk">
+    <xsl:call-template name="chunk"/>
+  </xsl:variable>
 
-<xsl:template match="article/appendix">
   <div class="{name(.)}">
     <xsl:if test="$generate.id.attributes != 0">
       <xsl:attribute name="id">
       </xsl:attribute>
     </xsl:if>
 
-    <xsl:call-template name="section.heading">
-      <xsl:with-param name="level" select="2"/>
-      <xsl:with-param name="title">
-        <xsl:apply-templates select="." mode="object.title.markup"/>
-      </xsl:with-param>
-    </xsl:call-template>
+    <xsl:choose>
+      <xsl:when test="parent::article and $ischunk = 0">
+        <xsl:call-template name="section.heading">
+          <xsl:with-param name="level" select="2"/>
+          <xsl:with-param name="title">
+            <xsl:apply-templates select="." mode="object.title.markup"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="component.separator"/>
+        <xsl:call-template name="appendix.titlepage"/>
+      </xsl:otherwise>
+    </xsl:choose>
 
     <xsl:variable name="toc.params">
       <xsl:call-template name="find.path.params">
     </xsl:if>
 
     <xsl:apply-templates/>
+
+    <xsl:if test="not(parent::article) or $ischunk != 0">
+      <xsl:call-template name="process.footnotes"/>
+    </xsl:if>
   </div>
 </xsl:template>