Page 1 of 1

XSL override dita2html5.xsl

Posted: Tue Jun 09, 2026 3:49 pm
by TopSolid
Hi!
AFAIK, when transforming from DITA to WebHelp, the 2 first steps are:
  • dita2html5 = generic engine DITA-OT
  • dita2webhelp = UI Oxygen
WebHelp proposes official endpoints to override xsl.
https://www.oxygenxml.com/doc/versions/ ... uyr_b1y_bx
I have in my dita source

Code: Select all

<area>
   <xref outputclass="popup-link"/>
</area>
I want final result in HTML5

Code: Select all

<area href="..." shape="rect" class="popup-link">
But the first step dita2html5 that generates <area href="..." shape="rect"> looses my class and next step dita2webhelp is too late.

So, is there a way to override dita2html5 endpoint inside an opt with WebHelp engine? Example:

Code: Select all

 <xslt>
            <extension file="resources/xsl/imagemap-override.xsl" id="com.oxygenxml.webhelp.xsl.dita2webhelp"/>
            <extension file="resources/xsl/imagemap-override.xsl" id="com.oxygenxml.webhelp.xsl.dita2html5"/>
            <extension file="resources/xsl/imagemap-override.xsl" id="org.dita.html5.xsl.dita2html5"/>
</xslt>
Thanks for help

Re: XSL override dita2html5.xsl

Posted: Wed Jun 10, 2026 2:38 pm
by julien_lacour
Hello,

Not exactly. As you correctly identified, the main processing step is dita2webhelp, and can be extended using the com.oxygenxml.webhelp.xsl.dita2webhelp extension point.

WebHelp Responsive pipeline leverages parts of the standard DITA-OT HTML5 plugin, and those processing stages can also be customized or overridden through the same extension point, so you can perfectly declare:

Code: Select all

<xslt>
  <extension file="resources/xsl/imagemap-override.xsl" id="com.oxygenxml.webhelp.xsl.dita2webhelp"/>
</xslt>
And add the following template in imagemap-override.xsl:

Code: Select all

<!-- Copied from org.dita.html5/xsl/ut-d.xsl -->
<xsl:template match="*[contains(@class, ' topic/xref ')]" mode="imagemap-xref">
  <xsl:attribute name="href"><xsl:call-template name="href"/></xsl:attribute>
  <xsl:if test="@outputclass">
    <xsl:attribute name="class" select="@outputclass"/>      
  </xsl:if>
  <xsl:if test="@scope='external' or @type='external' or ((@format='PDF' or @format='pdf') and not(@scope='local'))">
    <xsl:apply-templates select="." mode="external-link"/>
  </xsl:if>
</xsl:template>
And you will get <area class="popup-link" href="..." shape="rect"> in the output.

Regards,
Julien