What is the difference between global attributes and local attributes in DITA specialization?

In DITA specialization, local and global attributes refer to two distinct types of attributes that can be used to extend and customize the markup of DITA elements. Local attributes are limited in scope to a single element or element type, while global attributes are applicable to all element types.

Local Attributes:

Local attributes are specific to a particular DITA element and are defined within the specialization schema for that element. These attributes are unique to the element they are defined for and do not apply to other elements unless explicitly defined for them.

Local attributes are scoped to the element they are defined for, meaning they are only available and applicable to that specific element type within the specialization schema.

Example: A DITA specialization for a “product” element requires a “version” attribute that’s specific to the “product” element. This “version” attribute would be defined as a local attribute within the specialization schema for the “product” element. This attribute is not available for other DITA elements.

Global Attributes:

Global attributes, on the other hand, are attributes that can be used across multiple DITA elements. These attributes are defined at a higher level in the DITA specialization hierarchy, making them available for use by multiple elements without the need for explicit redefinition.

Global attributes have a broader scope and can be applied to multiple elements within a specialization schema. They are not tied to a single element type.

Example: A “status” attribute needs to be introduced that can be used to indicate the status of various elements across different parts of the specialization schema, such as indicating the status of a “section,” “step,” or “note.” The “status” attribute would be defined as a global attribute at a higher level in the specialization hierarchy. This allows the use of the “status” attribute across multiple DITA elements without redefining it for each element type.