]> granicus.if.org Git - docbook-dsssl/commitdiff
Added a "not(ancestor::title)" test to work around "too many nested
authorMauritz Jeanson <mj@johanneberg.com>
Sat, 13 Oct 2007 07:03:17 +0000 (07:03 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Sat, 13 Oct 2007 07:03:17 +0000 (07:03 +0000)
apply-templates" problems when processing xrefs or links in no.anchor.mode mode.
Hopefully, this closes bug #1811721.

xsl/common/titles.xsl

index 907871fab8af5352975241c4452224bf63654cff..8416de3ac6aa100e4a495c310bcdc4191b2cfeb3 100644 (file)
@@ -710,25 +710,39 @@ title of the element. This does not include the label.
     </xsl:when>
 
     <xsl:otherwise>
-      <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
-
-      <xsl:apply-templates select="$target" mode="xref-to">
-        <xsl:with-param name="referrer" select="."/>
-        <xsl:with-param name="xrefstyle">
-          <xsl:choose>
-            <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
-              <xsl:value-of select="@role"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="@xrefstyle"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:with-param>
-      </xsl:apply-templates>
-
-      <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+      
+      <xsl:choose>
+       <!-- Watch out for the case when there is a xref or link inside 
+            a title. See bug #1811721. -->
+       <xsl:when test="not(ancestor::title)">
+         <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+         
+         <xsl:apply-templates select="$target" mode="xref-to">
+           
+           <xsl:with-param name="referrer" select="."/>
+           <xsl:with-param name="xrefstyle">
+             <xsl:choose>
+               <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
+                 <xsl:value-of select="@role"/>
+               </xsl:when>
+               <xsl:otherwise>
+                 <xsl:value-of select="@xrefstyle"/>
+               </xsl:otherwise>
+             </xsl:choose>
+           </xsl:with-param>
+         </xsl:apply-templates>
+         
+         <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+       </xsl:when>
+       
+       <xsl:otherwise>
+         <xsl:apply-templates/>
+       </xsl:otherwise>
+      
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
+
 </xsl:template>
 
 <!-- ============================================================ -->