Can custom attributes be added to standard DITA elements?

In DITA XML, it’s possible to add custom attributes to standard DITA elements, allowing you to extend the metadata associated with these elements. This capability provides flexibility for documenting specific information or characteristics that may not be covered by the standard DITA attributes. Custom attributes are particularly useful when you need to tailor DITA to your organization’s unique documentation requirements.

Extending Standard DITA Elements

Custom attributes can be added to elements like <topic>, <title>, <body>, and others to provide additional context or categorization. For example, if you’re documenting a complex product with unique properties, you can create custom attributes to capture product-specific information.

Example:

Here’s an example of how custom attributes can be added to a standard DITA element:


<topic id="product123">
  <title>Product Documentation</title>
  <custom_attribute1>Custom Value 1</custom_attribute1>
  <custom_attribute2>Custom Value 2</custom_attribute2>
  <body>...

In this example, custom attributes custom_attribute1 and custom_attribute2 are added to the <topic> element to capture specific product-related data. This customization allows for more detailed product documentation without modifying the DITA standard.