How is metadata added to DITA content?

Adding metadata to DITA content is a crucial aspect of effectively managing and organizing your documentation. Metadata provides valuable information about the content, such as its title, author, subject, and keywords. This extra information helps users, content creators, and systems better understand the context and attributes of a particular piece of content. Below, you’ll find an explanation of how to add metadata to DITA content, including the key elements and attributes used for this purpose.

Key Elements and Attributes

The two primary elements used to add metadata to DITA content are <prolog> and <metadata>. The <prolog> element encapsulates metadata related to the entire document, while the <metadata> element provides metadata at a topic level. Some of the essential attributes used within these elements include:

  • Author: Specifies the creator or author of the content.
  • Subject: Describes the subject matter or topic of the content.
  • Title: Indicates the title or name of the content.
  • Keywords: Provides a list of keywords associated with the content, aiding in search and categorization.

Example:

Here’s an example of how metadata is added to a DITA topic:


<topic>
  <title>How to Install a Software</title>
  <prolog>
    <metadata>
      <author>John Doe</author>
      <subject>Software Installation</subject>
      <keywords>installation, software, guide</keywords>
    </metadata>
  </prolog>
  <body>
    <p>This topic provides a step-by-step guide on how to install the XYZ software.</p>
    <step>
      <cmd>Download the XYZ software installation package.</cmd>
      <info>Make sure to choose the appropriate version.</info>
    </step>
    <step>
      <cmd>Run the installer.</cmd>
    </step>
    <step>
      <cmd>Follow the on-screen instructions.</cmd>
    </step>
  </body>
</topic>

In this example, the metadata elements within the <prolog> section provide information about the author, subject, and keywords associated with the topic. This metadata enhances the content’s discoverability and categorization.