Dynamically discard registered trademark symbol

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
antoterrence
Posts: 28
Joined: Sat May 04, 2019 5:55 pm

Dynamically discard registered trademark symbol

Post by antoterrence » Thu Sep 12, 2019 5:08 pm

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?

ionela
Posts: 296
Joined: Mon Dec 05, 2011 6:08 pm

Re: Dynamically discard registered trademark symbol

Post by ionela » Mon Sep 16, 2019 3:27 pm

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
Ionela Istodor
oXygen XML Editor and Author Support

antoterrence
Posts: 28
Joined: Sat May 04, 2019 5:55 pm

Re: Dynamically discard registered trademark symbol

Post by antoterrence » Tue Sep 17, 2019 12:20 pm

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.

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamically discard registered trademark symbol

Post by Radu » 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

antoterrence
Posts: 28
Joined: Sat May 04, 2019 5:55 pm

Re: Dynamically discard registered trademark symbol

Post by antoterrence » Wed Oct 02, 2019 11:37 pm

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

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamically discard registered trademark symbol

Post by Radu » Thu Oct 03, 2019 8:00 am

Hi Antony,

Thanks for posting the solution.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply