]> granicus.if.org Git - docbook-dsssl/commitdiff
Added an update the fix made in revision 7528 (handling of xref/link in no.anchor...
authorMauritz Jeanson <mj@johanneberg.com>
Fri, 30 Nov 2007 17:22:54 +0000 (17:22 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Fri, 30 Nov 2007 17:22:54 +0000 (17:22 +0000)
Having xref in title is not a problem as long as the target is not an ancestor element.
Closes bug #1838136.

Note that an xref that is in a title and whose target is an ancestor element is still not
rendered in the TOC. This could be considered a bug, but on the other hand I cannot really
see the point in having such an xref in a document.

xsl/common/titles.xsl

index 8416de3ac6aa100e4a495c310bcdc4191b2cfeb3..9495e34ffaa7409a99518be12a374bc1448a8283 100644 (file)
@@ -710,11 +710,12 @@ title of the element. This does not include the label.
     </xsl:when>
 
     <xsl:otherwise>
-      
+   
       <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)">
+            a title. See bugs #1811721 and #1838136. -->
+       <xsl:when test="not(ancestor::*[@id = $target/@id] or ancestor::*[@xml:id = $target/@xml:id])">
+
          <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
          
          <xsl:apply-templates select="$target" mode="xref-to">