DITA webhelp output - how to change hovertext for <term> element?

dariahutch
Posts: 4
Joined: Fri Jan 20, 2012 2:29 am

DITA webhelp output - how to change hovertext for <term> element?

Post by dariahutch » Mon Mar 12, 2012 10:17 pm

In the DITA webhelp output, an xref link shows the shortdesc of the target topic when you hover over it. I want to have the same behavior for <term keyref> links to glossary entry topics. Right now it shows the topic title in the hover text instead of the shortdesc in the hover text. How can I change that?

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

Re: DITA webhelp output - how to change hovertext for <term> element?

Post by Radu » Tue Mar 13, 2012 1:05 pm

Hi,

If you look in this XSL:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/xsl/xslhtml/dita2htmlImpl.xsl

it contains a template called:

Code: Select all

<xsl:template match="*[contains(@class,' topic/term ')]" name="topic.term">....
That template contains 2 variables called:

Code: Select all

<xsl:variable name="displaytext">....
which is the link text and:

Code: Select all

<xsl:variable name="hovertext">....
which is the tooltip which appears on such a link.

The "hovertext" seems to look mostly at glossSurfaceForm so if your glossentry has a content like:

Code: Select all

<glossentry id="glossentry_5ym_llv_4f">
<glossterm>Data Definition Language</glossterm>
<glossBody>
<glossSurfaceForm>THE SURFACE FORM</glossSurfaceForm>
</glossBody>
</glossentry>
Then the hovertext tooltip will be computed to be THE SURFACE FORM.

http://docs.oasis-open.org/dita/v1.2/os ... urfaceForm

But the "displaytext" variable also prefers the surface form if the term keyref is the first keyref in the topic.
The idea would be that on the first encounter the surface form is displayed on a link and then on previous references to the key the acronym (<glossterm>) is used instead.

I think that you can make some modifications in the "displaytext" to only show the acronym.

The general idea behind the behavior of acronyms in DITA is explained here:

http://www.oasis-open.org/committees/do ... cronym.pdf

but not everything is implemented properly in the DITA Open Toolkit so you should also check how publishing works in PDF for example.

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

Post Reply