Can custom metadata be defined in DITA?

In DITA, it is possible to define custom metadata to extend the standard set of metadata elements. This capability allows content creators to tailor metadata to specific content management and documentation requirements.

Custom metadata involves defining new metadata elements with unique names, attributes, and structures. These custom elements can be included in DITA topics or documents to capture additional information that is not covered by the standard metadata elements.

Implementing custom metadata involves defining the custom element, specifying the element structure, setting the document metadata values, validating the metadata, and defining use cases.

Define Custom Metadata Element

To create custom metadata, define a new XML element with a unique name. This element will represent the custom metadata and can have attributes to capture specific metadata values.

Specify Element Structure

Determine how the custom metadata element will be structured. Sub-elements or attributes within the custom element can be defined to capture relevant metadata details.

Document Metadata Values

When creating or editing DITA topics or documents, custom metadata elements can be inserted and have values provided for them. These values should align with the purpose of the custom metadata.

Validation

Ensure that the DITA processing environment is aware of the custom metadata elements and knows how to handle them. This may require configuration or customization of DITA processing tools.

Use Cases

Custom metadata can be employed in various scenarios. For example, custom metadata elements may be defined to capture specific product version numbers, project IDs, or document revision histories.

Example

Let’s say an organization is managing software documentation and wants to capture information about the software versions associated with each topic. They can define a custom metadata element called <software-version> to store this information. Here’s how it might look:


<metadata>
    <title>Software Installation Guide</title>
    <author>John Doe</author>
    <subject>Software Documentation</subject>
    <keywords>installation, software, guide</keywords>
    <pubdate>2023-09-15</pubdate>

    <!-- Custom Metadata -->
    <software-version product="Product A">v2.0</software-version>
</metadata>
    

In this example, <software-version> is a custom metadata element that captures the software version (v2.0) and the associated product (Product A). This custom metadata provides additional context about the document’s content.