Glossary Document

The introduction to a WordprocessingML document formally introduced the concept of stories, individual ranges of a word-processing document containing block-level content like paragraphs and tables. Some examples of stories in a WordprocessingML document include the following: the main document, headers, footers, comments, footnotes, and endnotes.

At that time, a story was defined by two characteristics:

  • It is a unique region containing block-level content

  • All document stories shared the same set of properties (e.g., style definitions, numbering definitions, and settings)

The glossary document, although it follows the first rule, actually defies the second.

Within a WordprocessingML file, the glossary document is a supplemental storage location for additional document content which shall travel with the document, but which shall not be displayed for printed as part of the main document until it is explicitly added to that document by deliberate action.

The glossary document shall also be afforded a separate instance of all of the relationships that are provided on the main document part - this means that the glossary document shall have its own style definitions, numbering definitions, comments, headers, footers, etc. within the WordprocessingML document.

Consider a document that shall include ten optional clauses that may be inserted through a user interface. It is clearly not desirable to have these ten clauses appear in the main document story's contents before they are explicitly inserted, therefore each of them may be stored in the glossary document and inserted via the user interface as needed.

Within the glossary document, each distinct region of document content is referred to as a glossary document entry, and is defined via the <docPart> element. These document parts may contain any block-level WordprocessingML element, and may also have a set of classifications and behaviors applied to them via the glossary document entry's properties.

Consider the following definition for the contents of a glossary document part within a WordprocessingML document:

<w:glossaryDocument>
  <w:docParts>
    <w:docPart>
      <w:docPartPr></w:docPartPr>
      <w:docPartBody>
        <w:p>
          <w:r>
            <w:t>Sample entry.</w:t>
          </w:r>
        </w:p>
      </w:docPartBody>
    </w:docPart>
    <w:docPart></w:docPart>
  </w:docParts>
</w:glossaryDocument>

The <glossaryDocument> element defines the contents of the glossary document part. Within the glossary document, each <docPart> element contains the definition for one glossary document entry: in this case, there are two entries in the glossary document, the first of which contains a single paragraph with a single run of text.

Each glossary document entry consists of two components:

  • The entry's properties, specified using the <docPartPr> element

  • The entry's contents, specified using the <docPartBody> element

The first specifies information about the entry (e.g., its classification) for when it is inserted, the latter stores the block level content which constitutes the entry.