Topic number with the title in cross references
Posted: Wed Oct 15, 2025 10:20 am
Hi
When cross referencing topics within a ditamap, the PDF output (using XSL-FO) shows the link in format "Topic title on page 123". How can I edit the configuration that the link also contains the topic number? So the output I'd like would be in format "1.2 Topic title on page 123".
Example from PDF output: I found that the cross references are controlled through file links.xsl but for the life of me cannot figure out what must be added to get the topic number appear before the title text.
...
Thanks,
Mika
When cross referencing topics within a ditamap, the PDF output (using XSL-FO) shows the link in format "Topic title on page 123". How can I edit the configuration that the link also contains the topic number? So the output I'd like would be in format "1.2 Topic title on page 123".
Example from PDF output: I found that the cross references are controlled through file links.xsl but for the life of me cannot figure out what must be added to get the topic number appear before the title text.
Code: Select all
<xsl:variable name="referenceTitle" as="node()*">
<xsl:apply-templates select="." mode="insertReferenceTitle">
<xsl:with-param name="href" select="@href"/>
<xsl:with-param name="titlePrefix" select="''"/> <-- should something be added here?
<xsl:with-param name="destination" select="$destination"/>
<xsl:with-param name="element" select="$element"/>
</xsl:apply-templates>
</xsl:variable>Code: Select all
<xsl:when test="not(@scope = 'external' or not(empty(@format) or @format = 'dita')) and exists($referenceTitle)">
<xsl:copy-of select="$referenceTitle"/>
</xsl:when>Mika