Detecting WebHelp transformation in DITA-OT plugin

Post here questions and problems related to editing and publishing DITA content.
HomeGoods
Posts: 96
Joined: Wed Feb 09, 2005 8:57 am

Detecting WebHelp transformation in DITA-OT plugin

Post by HomeGoods »

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: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Detecting WebHelp transformation in DITA-OT plugin

Post by radu_pisoi »

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: 96
Joined: Wed Feb 09, 2005 8:57 am

Re: Detecting WebHelp transformation in DITA-OT plugin

Post by HomeGoods »

Thank you, Radu. Worked quite nicely.
Post Reply