Detecting WebHelp transformation in DITA-OT plugin

HomeGoods
Posts: 87

Detecting WebHelp transformation in DITA-OT plugin

Sat Jun 18, 2016 1:16 pm

Hi,
I have a DITA-OT plugin that is installed via this extension point:

Code: Select all

<feature
        extension="dita.xsl.xhtml"
        file="my-custom.xsl" />

In that "my-custom.xsl", I want to know if it is currently running for WebHelp transformation or not. What do you think is the most reliable way?
If possible, I like to detect its type (Classic or Responsive).
radu_pisoi
Posts: 335
Location: Craiova

Re: Detecting WebHelp transformation in DITA-OT plugin

Tue Jun 21, 2016 3:27 pm

Hi,

Yes, it is possible by creating the 'TRANSTYPE' XSLT parameter in your custom stylesheet. It's value will be assigned either to 'webhelp-responsive' for Webhelp Responsive transformation or to 'webhelp' for Webhelp Classic transformation.

Code: Select all

<xsl:param name="TRANSTYPE"></xsl:param>
  <xsl:template ...>
    <xsl:choose>
      <xsl:when test="$TRANSTYPE = 'webhelp-responsive'">
        Webhelp Responsive transformation
      </xsl:when>
      <xsl:when test="$TRANSTYPE = 'webhelp'">
        Webhelp Classic transformation
      </xsl:when>
      <xsl:otherwise>
        Other type of XHTML transformation
      </xsl:otherwise>
    </xsl:choose>
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
HomeGoods
Posts: 87

Re: Detecting WebHelp transformation in DITA-OT plugin

Tue Jun 21, 2016 6:19 pm

Thank you, Radu. Worked quite nicely.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 3 guests