Working with a Glossary of Terms in DITA
There are several ways to manage a Glossary of Terms in DITA, but it is considered best practices to create a separate submap for the glossary and embed that glossary map in the main (root) map. The actual glossary terms are small glossary entry topics that are referenced in the glossary map. You can add links to the glossary terms in the output and you can even define abbreviated forms for terms that have an acronym or some other type of abbreviation.
How to Create a Glossary of Terms in Oxygen XML Editor
- Create a new submap for your glossary and embed it in your main map.
-
Create a glossary entry topic (
<glossentry>
) for each glossary term. The<glossentry>
element may contain numerous optional glossentry elements, but every glossentry topic must contain a<glossterm>
and<glossdef>
element. The<glossterm>
is the name of the term while the<glossdef>
is its definition.Here is an simple example:<glossentry id="ddl"> <glossterm>Data Definition Language</glossterm> <glossdef>A language used for defining database schemas.</glossdef> </glossentry>
The easiest way to create a glossentry topic in Oxygen XML Editor:- Click the New file wizard button on the toolbar.
- Type glossentry in the search field at the top of the dialog box.
- Select the Glossentry DITA topic type, configure the name and optionally the title, and click Create.
-
Reference each glossary entry topic in your glossary submap using the
<glossref>
element. This element requires a@keys
attribute. Please make sure the@print
attribute is set toyes
to show the glossary also in the PDF output.<glossref keys="gloss_ddl" href="ddl.dita" print="yes"/>
The easiest way to reference a glossentry in Oxygen XML Editor:-
With the glossary entry topic opened in the main editor, open the glossary submap in the DITA Maps Manager, right-click the map node and select (if you already have existing glossentry topics, you can right-click the glossentry where you want to insert the new one and select ).
Step Result: This opens the Insert Reference dialog box.
- Go to the Keys tab and enter a name in the Define keys field.
- Go to the Attributes tab and select Glossary Reference from the Reference type drop-down list at the top of the dialog box.
- Click Insert and Close.
-
<glossgroup>
element.How to Create Links to Glossary Terms
<term>
element (or
<abbreviated-form>
element as described in the next section) with a @keyref
attribute that
references the corresponding key specified in the <glossref>
. Of
course, the <glossref>
points to the
<glossentry>
topic where the glossary term is
defined.<term keyref="gloss_ddl"/>
In the output, the text specified in the <glossterm>
element is
displayed for the glossary term with a link to its glossentry topic that contains its
definition.
<term>
element and reference the glossary
term in Oxygen XML Editor:- Place the cursor at the location where you want to insert a link to the glossary term.
- In the DITA Reusable Componts view, go to the Keys tab and use the search filter field at the top of the view to find the key for the particular glossary term.
- Right-click the key and select .
Using Abbreviated Forms (Acronyms) with Glossary Terms
The <abbreviated-form>
element
can be used for glossary terms that you want to appear in an abbreviated form (such as an
acronym). Abbreviated forms are expanded to their full form the first time that they appear
in a document, and then all subsequent instances will display the short form (or acronym).
You would need to define the long and short forms in the <glossentry>
and then reference it with the <abbreviated-form>
element (instead of
the <term>
element).
<glossentry id="ddl">
<glossterm>Data Definition Language</glossterm>
<glossBody>
<glossSurfaceForm>Data Definition Language (DDL)</glossSurfaceForm>
<glossAlt>
<glossAcronym>DDL</glossAcronym>
</glossAlt>
</glossBody>
</glossentry>
The long form is declared using the <glossSurfaceForm>
element while
the short form is declared using the <glossAcronym>
element.
<abbreviated-form>
element:<abbreviated-form keyref="gloss_ddl"/>
For more information about the recommended best practices for using abbreviations, including information about using multiple languages, see: http://www.oasis-open.org/committees/download.php/29734/AcronymBestPractice_08112008.doc.