]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix nav element for case of empty TOC (no chapters or sections).
authorBob Stayton <bobs@sagehill.net>
Thu, 9 Feb 2012 04:11:45 +0000 (04:11 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 9 Feb 2012 04:11:45 +0000 (04:11 +0000)
xsl/epub3/epub3-element-mods.xsl

index a5e51b35813d568bfdac06ec442f907a859ebc11..83066ec856be9468c04a727eec8a82929be5750d 100644 (file)
@@ -1954,32 +1954,32 @@ article  toc,title,figure,table,example,equation
     <xsl:otherwise>
       <xsl:choose>
         <xsl:when test="$qanda.in.toc != 0">
-          <xsl:if test="$nodes.plus">
-            <div class="toc">
-              <xsl:copy-of select="$toc.title"/>
-              <nav epub:type="toc">
-                <xsl:element name="{$toc.list.type}">
+          <div class="toc">
+            <xsl:copy-of select="$toc.title"/>
+            <nav epub:type="toc">
+              <xsl:element name="{$toc.list.type}">
+                <xsl:if test="$nodes.plus">
                   <xsl:apply-templates select="$nodes.plus" mode="toc">
                     <xsl:with-param name="toc-context" select="$toc-context"/>
                   </xsl:apply-templates>
-                </xsl:element>
-              </nav>
-            </div>
-          </xsl:if>
+                </xsl:if>
+              </xsl:element>
+            </nav>
+          </div>
         </xsl:when>
         <xsl:otherwise>
-          <xsl:if test="$nodes">
-            <div class="toc">
-              <xsl:copy-of select="$toc.title"/>
-              <nav epub:type="toc">
-                <xsl:element name="{$toc.list.type}">
+          <div class="toc">
+            <xsl:copy-of select="$toc.title"/>
+            <nav epub:type="toc">
+              <xsl:element name="{$toc.list.type}">
+                <xsl:if test="$nodes">
                   <xsl:apply-templates select="$nodes" mode="toc">
                     <xsl:with-param name="toc-context" select="$toc-context"/>
                   </xsl:apply-templates>
-                </xsl:element>
-              </nav>
-            </div>
-          </xsl:if>
+                </xsl:if>
+              </xsl:element>
+            </nav>
+          </div>
         </xsl:otherwise>
       </xsl:choose>