What is the hierarchy of elements in a DITA map?
DITA maps have a hierarchical structure with several key elements, including the root <map>
element, followed by a series of <title>
, <topicref>
, and other elements. This hierarchy allows for the organization and structure of topics within the map, enabling content management and presentation control.
Key Elements in DITA Map Hierarchy
DITA maps are structured hierarchically, consisting of various elements that organize and control the presentation of topics.
Root <map>
Element
The <map>
element is the root element of a DITA map. It defines the map and serves as the container for the entire map structure.
<title>
Element
The <title>
element is typically the first child of the <map>
element. It specifies the title of the map, providing a clear label for the document.
<topicref>
Elements
The primary content of a DITA map is organized using <topicref>
elements. These elements reference DITA topics, and their order within the map determines the sequence in which topics are presented. <topicref>
elements can be nested to create hierarchies, allowing for chapters, sections, and subsections within the map.
Metadata and Attributes
In addition to the basic structure, DITA maps can include metadata elements like <shortdesc>
and attributes like keyref
, locktitle
, and scope
to provide additional information, control presentation, and define relationships between topics.
Example
A DITA map follows a hierarchical structure.
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>Product User Guide</title>
<topicref href="introduction.dita" />
<topicref href="installation.dita" />
<topicref href="operation.dita">
<topicref href="operation-basics.dita" />
<topicref href="operation-advanced.dita" />
</topicref>
<topicref href="troubleshooting.dita" />
</map>
In this example:
- The
<map>
element is the root of the DITA map. - A
<title>
element specifies the title of the map, which is “Product User Guide.” - Multiple
<topicref>
elements are used to reference individual DITA topics. The order of these elements determines the presentation sequence. - Nesting of
<topicref>
elements creates a hierarchy. In this example, “operation.dita” has two child topics, “operation-basics.dita” and “operation-advanced.dita,” forming a section with subsections within the map.