How to style dictionary elements: italic-style term description (bold-style shot abbreviation))

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

How to style dictionary elements: italic-style term description (bold-style shot abbreviation))

Post by DAN SEA »

Hello!
I tried to state the question in the title :-) but still I will explain: how to make a dictionary term inserted with using the DITA reusable components menu, - to look like this in the text: Some Term Explanation (STE)
Thanks in advance!
P.S. I know how to use this system, I just don't quite understand (at the moment) how to style it.
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to style dictionary elements: italic-style term description (bold-style shot abbreviation))

Post by Radu »

Hi,

It usually helps me if I have a small example of how the DITA XML structure looks like.
Do you have a DITA <glossentry> topic looking like this:

Code: Select all

<!DOCTYPE glossentry PUBLIC "-//OASIS//DTD DITA Glossary Entry//EN" "glossaryentry.dtd">
<glossentry id="abs-definition">
  <glossterm>Anti-lock Braking System</glossterm>
  <glossBody>
    <glossSurfaceForm>Anti-lock Braking System (ABS)</glossSurfaceForm>
    <glossAlt>
      <glossAcronym>ABS</glossAcronym>
    </glossAlt>
  </glossBody>
</glossentry>
referenced in the DITA Map with a key defined on the topicref:

Code: Select all

<topicref href="topics/abc.dita" keys="abs"/>
and then in the DITA topics do you use abbreviated-form element to refer to it?

Code: Select all

<abbreviated-form keyref="abs"/>
And you are interested in the published output, right? HTML or PDF?
Looking at the generated HTML output from the DITA topic, it looks something like this:

Code: Select all

 
<a href="untitled1.html" title="Anti-lock Braking System (ABS)"><dfn class="term abbreviated-form">Anti-lock Braking System (ABS)</dfn></a>
So the acronym appears in the same text as the gloss title, making it impossible to style separately using CSS.
Maybe this could be done with some XSLT customization, with a DITA OT plugin which overrides the xsl template:

Code: Select all

<xsl:template match="*" mode="getMatchingSurfaceForm">
from the base "DITA-OT3.x/plugins/org.dita.html5/xsl/topic.xsl" but this needs to be investigated, I do not have a quick fix for you.


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