Dynamically discard registered trademark symbol

Having trouble installing Oxygen? Got a bug to report? Post it all here.
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Dynamically discard registered trademark symbol

Post 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?
ionela
Posts: 402
Joined: Mon Dec 05, 2011 6:08 pm

Re: Dynamically discard registered trademark symbol

Post 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
Ionela Istodor
oXygen XML Editor and Author Support
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: Dynamically discard registered trademark symbol

Post 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.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamically discard registered trademark symbol

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: Dynamically discard registered trademark symbol

Post 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
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dynamically discard registered trademark symbol

Post by Radu »

Hi Antony,

Thanks for posting the solution.

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