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: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">