<mapref>: How do you use the <mapref> element to reference and include external DITA maps within another DITA map?

The <mapref> element in DITA XML is used to reference and include external DITA maps within another DITA map. This feature enables modular content authoring and content reuse, making it easier to manage and maintain large-scale documentation projects.

Referencing an External Map

To reference an external DITA map, you can use the <mapref> element as shown in the following example:


<mapref href="external-map.ditamap"/>

In this example, the <mapref> element references an external DITA map named “external-map.ditamap.” When you include this <mapref> element within your main DITA map, it effectively imports and integrates the content structure from the referenced map into your project.

This approach allows you to create a modular documentation system where different maps represent different sections or topics of your documentation. You can update and maintain these sections independently and then include them in your main map as needed, ensuring consistency and efficiency in your documentation workflow.