Page 1 of 1

Dynamically discard registered trademark symbol

Posted: Thu Sep 12, 2019 5:08 pm
by antoterrence
Hi,
We use a lot of variables for product names. The variable values contain the trademark symbols by default. However, the trademark symbol should not be used after the first occurrence. For example, if product A occurs twice, the second occurrence should not have the symbol in the output. Is there a way to discard it from the second occurrence when transformation is run?

Re: Dynamically discard registered trademark symbol

Posted: Mon Sep 16, 2019 3:27 pm
by ionela
Hi,

Could you please specify what kind of framework do you use as source file (DITA)? Also, what type of output do you try to obtain(WebHelp Responsive, PDF, etc) and which transformation do you run in oXygen XML?

Regards,
Ionela

Re: Dynamically discard registered trademark symbol

Posted: Tue Sep 17, 2019 12:20 pm
by antoterrence
Hi,
Thank you for the response.
Framework is a custom framework based on the default DITA framework.

Outputs = PDF, Webhelp, CHM

We are planning to modify the PDF and webhelp output using CSS customization features.

Re: Dynamically discard registered trademark symbol

Posted: Fri Sep 20, 2019 10:53 am
by Radu
Hi,

The XSLT stylesheet which outputs the HTML content for the DITA <tm> is located in:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x/plugins/org.dita.html5/xsl/topic.xsl

There is an XSLT template which matches the <tm> element:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/tm ')]" name="topic.tm">
and maybe you can create an HTML customization XSLT which overrides this stylesheet and avoids outputting the trademark symbol if in the same file there has been a previous trademark.

Regards,
Radu

Re: Dynamically discard registered trademark symbol

Posted: Wed Oct 02, 2019 11:37 pm
by antoterrence
Radu wrote: Fri Sep 20, 2019 10:53 am Hi,

The XSLT stylesheet which outputs the HTML content for the DITA <tm> is located in:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x/plugins/org.dita.html5/xsl/topic.xsl

There is an XSLT template which matches the <tm> element:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/tm ')]" name="topic.tm">
and maybe you can create an HTML customization XSLT which overrides this stylesheet and avoids outputting the trademark symbol if in the same file there has been a previous trademark.

Regards,
Radu
Hi Radu,
Thanks for directing me to that xsl file. I could find a solution by overriding the <xsl:template match="*[contains(@class, ' topic/tm ')]" name="topic.tm">.

Code: Select all

<xsl:variable name="usebody">
                <xsl:choose>
                    <!-- ANTONY TERRENCE custom start-->
                    <xsl:when test="parent::*[contains(@class,'topic/ph')]/text()=preceding::*[contains(@class, ' topic/ph ')][not(parent::*[contains(@class, 'topic/title')])]/text()" >skip</xsl:when>
                    
                    <!-- ANTONY TERRENCE custom end-->
The only requirement is that the product names should be within the <ph> element.

Regards,
Antony Terrence

Re: Dynamically discard registered trademark symbol

Posted: Thu Oct 03, 2019 8:00 am
by Radu
Hi Antony,

Thanks for posting the solution.

Regards,
Radu