]> granicus.if.org Git - docbook-dsssl/commitdiff
Added modifications to support nested set elements. See bug #1853172.
authorMauritz Jeanson <mj@johanneberg.com>
Sat, 5 Jan 2008 16:06:30 +0000 (16:06 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Sat, 5 Jan 2008 16:06:30 +0000 (16:06 +0000)
xsl/fo/autotoc.xsl
xsl/fo/division.xsl

index 30f32778222cda8a413115025a174449ff5c0d68..99f3c88424c1f8bd394a19ab8c9ad9493a78f946 100644 (file)
@@ -29,7 +29,7 @@
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:variable name="nodes" select="book|setindex"/>
+  <xsl:variable name="nodes" select=".|book|set|setindex"/>
 
   <xsl:if test="$nodes">
     <fo:block id="toc...{$id}"
   </xsl:if>
 </xsl:template>
 
+<xsl:template match="set" mode="toc">
+  <xsl:param name="toc-context" select="."/>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="cid">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="$toc-context"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="toc.line">
+    <xsl:with-param name="toc-context" select="$toc-context"/>
+  </xsl:call-template>
+
+  <xsl:variable name="nodes" select="set|book|setindex"/>
+
+  <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
+
+  <xsl:if test="$toc.section.depth > 0 
+                and $toc.max.depth > $depth.from.context
+                and $nodes">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+      
+      <xsl:apply-templates select="$nodes" mode="toc">
+        <xsl:with-param name="toc-context" select="$toc-context"/>
+      </xsl:apply-templates>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template match="part" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
index 0b53b77bf23eae4afa26cb5d0b6d2a6c883a64c3..4249248cb8fe23a0d6e913de38452c4f513d7107 100644 (file)
@@ -63,9 +63,9 @@
   </xsl:variable>
 
   <xsl:variable name="preamble"
-                select="*[not(self::book or self::setindex)]"/>
+                select="*[not(self::book or self::set or self::setindex)]"/>
 
-  <xsl:variable name="content" select="book|setindex"/>
+  <xsl:variable name="content" select="book|set|setindex"/>
 
   <xsl:variable name="titlepage-master-reference">
     <xsl:call-template name="select.pagemaster">