Schema Documentation - Book Profile
version 1.0

The block variant of the glossary element

On this page:

The glossary element represents a glossary, pronunciation guide or other section that exclusively defines terms or phrases.

The Block variant is an adaptation for use including terms and definitions that have been grouped within the body of a work.

Usage Example

<glossary>
    <entry>
        <term>Arroba</term>,
        <definition>A weight equal to twenty-five pounds Spanish</definition>.
    </entry>
    …
</glossary>
    

Allowed parents

section

Allowed children

This element must not contain text.

This element must contain the following children: entry

Content model

Variants

This element exists in 2 variants. The other variant is the section variant.

Namespace

http://www.daisy.org/ns/z3998/authoring/

Usage Details

The greatest advantage to using the dedicated glossary element over hand-rolled solutions is the automatic association it allows when an entry contains exactly one term and one definition (which covers most glossaries and definition lists). The element is also intended to provide flexibility to accommodate the various forms definition lists take in production. A numbered definition list, for example, can be created using the Content Rendition feature's prefix attribute:

<glossary>
   <entry rend:prefix="1.">
      <term>evolution</term> — <definition>the process by which ...</definition>
   </entry>
   <entry rend:prefix="2.">
      <term>gene</term> — <definition>a segment of DNA...</definition>
   </entry>
</glossary>
        

The definitions could be turned into a variable list through use of CSS styles. Removing the em dashes and attaching a class attribute to the glossary element in the preceding example with a value of varlist, for example, would allow the creation of the following style definitions to re-flow the content:



glossary.varList > entry > term {
   display: block;
   padding-bottom: .2em
   font-weight: bold;
}

glossary.varList > entry > definition {
   display: block;
   margin-left: 2em;
}


        

Although it is recommended that the glossary element be used whenever possible, there are no restrictions against creating definition lists using other combinations of elements. The list element can simplify aspects (auto numbering, specifically), but at the price of having to explicitly link the terms and definitions in each entry. The first example above could be reformulated as a list as follows:

<list type="ordered">
   <item><term ref="def1">evolution</term> — <definition xml:id="def1">the process by which ...</definition></item>
   <item><term ref="def2">gene</term> — <definition xml:id="def2">a segment of DNA...</definition></item>
</list>
        

A variable list can also be implemented in a similar fashion with the addition of CSS styles:

<list class="varList">
   <item>
      <term ref="defn1">evolution</term>
      <definition xml:id="defn1">the process by which ...</definition>
   </item>
   <item>
      <term ref="defn2">gene</term>
      <definition xml:id="defn2">a segment of DNA...</definition>
   </item>
</list>
        

The absence of the type attribute on the list element in the preceding example outputs each item without a prefix, similar to the default formatting for glossary entries.

There are times where even more simplicity is needed. The glossary and list elements can be used for single definitions, but are typically more tagging than is needed, especially when the definition occurs in the flow of the body:

<p>
   A <term ref="defn01">gene</term> is <definition xml:id="defn01">a segment of DNA...</definition>. 
</p>
        

The convenience of using term and definition in these ways comes at the price of having to explicitly link the elements together via their ref and xml:id attributes, however.