How are metadata and attributes associated with a DITA map?

Metadata and attributes in a DITA map provide additional information and properties that help define the map’s structure, behavior, and presentation. These elements include attributes like keyref and metadata such as title, which offer flexibility in map organization and content presentation.

Metadata Elements

In a DITA map, metadata and attributes play a crucial role in defining the structure, behavior, and presentation of the map’s content. Assigning metadata to a map involves using metadata elements, applying attributes, and controlling presentation and behavior.

Metadata Elements

Metadata elements provide essential information about the DITA map and its components. The <title> element, for example, specifies the title of the map, while the <shortdesc> element allows authors to provide a brief description of the map’s content. These metadata elements contribute to the map’s accessibility and searchability.

Attributes

Attributes are additional properties assigned to elements within the DITA map. One commonly used attribute is keyref, which associates topics within the map based on a common key value. This allows for the creation of relationships and hierarchies in the map. Additionally, attributes like locktitle can be applied to prevent the titles of referenced topics from being overridden, ensuring consistency in presentation.

Presentation and Behavior

Metadata and attributes also influence the presentation and behavior of the map and its topics. For example, the locktitle attribute can prevent the titles of referenced topics from being replaced by titles defined in the map, maintaining consistency. These attributes and metadata elements allow authors to tailor the map to meet specific requirements.

Example

Here’s an example of a DITA map with metadata and attributes in XML format:


<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
  <title>Product User Guide</title>
  <shortdesc>This guide provides instructions for using the product.</shortdesc>
  <topicref href="introduction.dita" />
  <topicref href="installation.dita" />
  <topicref href="operation.dita" keyref="overview" />
  <topicref href="troubleshooting.dita" locktitle="yes" />
</map>
    

In this example:

  • The <title> element specifies the title of the DITA map, which is “Product User Guide.”
  • The <shortdesc> element provides a brief description of the map’s content.
  • The keyref attribute in the third <topicref> element associates the topic with the key value “overview,” creating a relationship within the map.
  • The locktitle attribute in the fourth <topicref> element is set to “yes,” ensuring that the title of the referenced topic remains unchanged, preserving consistency in presentation.