]> granicus.if.org Git - docbook-dsssl/commitdiff
In no.anchor.mode, test for any link descendants and switch to
authorBob Stayton <bobs@sagehill.net>
Wed, 11 Aug 2004 18:39:10 +0000 (18:39 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 11 Aug 2004 18:39:10 +0000 (18:39 +0000)
normal formatting if  there are none. This preserves formatting
in titleabbrev for TOC and headers.

xsl/common/titles.xsl

index 92453352a3244910e62dda6083f7e5596c23f0b7..db95071a9c78a41843a50f3c303d90f3cc8f00ff 100644 (file)
@@ -566,7 +566,22 @@ title of the element. This does not include the label.
 <!-- ============================================================ -->
 
 <xsl:template match="*" mode="no.anchor.mode">
-  <xsl:apply-templates mode="no.anchor.mode"/>
+  <!-- Switch to normal mode if no links -->
+  <xsl:choose>
+    <xsl:when test="descendant-or-self::footnote or
+                    descendant-or-self::anchor or
+                    descendant-or-self::ulink or
+                    descendant-or-self::link or
+                    descendant-or-self::olink or
+                    descendant-or-self::xref or
+                    descendant-or-self::indexterm">
+
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="."/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="footnote" mode="no.anchor.mode">