For certain cross-references, we have a special title-only link text format specified with @outputclass:
Code: Select all
<xref href="#tableid" outputclass="title"/>
We then have code applied by the
dita.xsl.topicpull extension point to implement it:
Code: Select all
<!-- a cross-reference with outputclass=='title' always uses the target title text -->
<xsl:template match="*[contains(@class, ' topic/table ') or contains(@class, ' topic/fig ')]"
mode="topicpull:resolvelinktext" priority="20">
<xsl:param name="linkElement" as="element()" tunnel="yes"/>
<xsl:choose>
<!-- business as usual if @outputclass != 'title' -->
<xsl:when test="not($linkElement[contains(@outputclass, 'title')])">
<xsl:next-match/>
</xsl:when>
<!-- force the title as the target text -->
<xsl:otherwise>
<xsl:variable name="target-text" as="xs:string*">
<xsl:apply-templates
select="*[contains(@class, ' topic/title ')]" mode="text-only"/>
</xsl:variable>
<xsl:value-of select="normalize-space(string-join($target-text, ''))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
PDF Chemistry ignores my
mode="insertReferenceTitle" template; I do not see it used in the merged XML code created by the merged2merged code, and I see that PDF Chemistry has its own
mode="insertReferenceTitle" target text machinery instead at
<oxygen>/frameworks/dita/DITA-OT3.x/plugins/com.oxygenxml.pdf.css/xsl/merged2merged/merged-links.xsl
Now here's where I am confused. In my plugin, if I extend
com.oxygenxml.pdf.css.xsl.merged2merged and add the following simple template, then *my*
mode="topicpull:resolvelinktext" code is used!
Code: Select all
<xsl:template match="*" mode="insertReferenceTitle" priority="100">
<xsl:next-match/>
</xsl:template>
But if I comment that template out, then PDF Chemistry's
mode="insertReferenceTitle" code is used instead. The template above shouldn't change anything; it should simply fall through to the next template. But its presence or absence makes my template get applied or not applied, respectively.
What would cause this?