override template in dita2htmlImpl.xsl with Oxygen Webhelp plugin version
Posted: Thu Aug 03, 2017 1:29 am
Hi,
We're trying to modify how the TOC in the Oxygen Webhelp renders glossary entries. While we can update the title in the topics to behave correctly, we cannot get the TOC to use the templates in the Oxygen Webhelp plugin. They always point to the template in org.dita.xhtml/dita2htmllImpl.xsl.
For example, we capitalize the first letter when a writer specifies @outputclass="cap_first_letter".
This works fine in the main topic but the TOC still shows the term in sentence case. I have tested adding this logic directly to the org.dita.xhtml plugin and it correctly applies the logic... I have tried setting the priority of the Oxygen Webhelp copy of this template, but it doesn't seem to do anything.
Thoughts?
Take care,
- Nick
We're trying to modify how the TOC in the Oxygen Webhelp renders glossary entries. While we can update the title in the topics to behave correctly, we cannot get the TOC to use the templates in the Oxygen Webhelp plugin. They always point to the template in org.dita.xhtml/dita2htmllImpl.xsl.
For example, we capitalize the first letter when a writer specifies @outputclass="cap_first_letter".
Code: Select all
<xsl:template match="*[contains(@class, ' topic/term ')]" mode="output-term" >
<xsl:param name="displaytext"/>
<dfn class="term">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="setidaname"/>
<xsl:choose>
<xsl:when test="normalize-space($displaytext)">
<xsl:call-template name="cap_first_letter">
<xsl:with-param name="displaytext">
<xsl:value-of select="$displaytext"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</dfn>
</xsl:template>
<xsl:template name="cap_first_letter">
<xsl:param name="displaytext"/>
<xsl:choose>
<xsl:when test="@outputclass = 'cap_first_letter'">
<xsl:value-of
select="translate(substring($displaytext, 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:value-of
select="substring($displaytext, 2, string-length($displaytext) - 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$displaytext"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Thoughts?
Take care,
- Nick