Chapter 5. Attribute Specialization Tutorial

Goal: Declare an attribute domain vocabulary module that provides a new conditional (property) attribute.

You can specialize from the @base and @props attributes. For conditional processing (filtering and flagging), this lets you add your own attributes rather than using @otherprops, which can be clearer to authors and implementors.

For this tutorial, the goal is to declare an attribute domain module that provides a new conditional attribute, in this case the "phase of the moon" condition, useful for medical information for werewolves and other lycanthropes.1

Attribute domains are the easiest form of specialization. It's so easy that you should never complain about missing conditional attributes in the base DITA specification, just declare your own.

The specialization requires two things:

1. For each specialization of @props, a .ent file that defines the attribute and a corresponding domain declaration. This is the "attribute domain vocabulary module".

2. Modification of any document type shells that need to reflect the specialized attribute (e.g., topic.dtd, reference.dtd, or your own specialized topic types' document type shells). You integrate the specialization attribute domain through the shell DTDs.

For this tutorial we want to create a specialization of @props called "phase-of-moon" that takes as its value one or more moon phase names (e.g., "full", "new", "waning", "waxing", etc.).

Note that an attribute domain always defines exactly one attribute. You cannot declare multiple attributes in a single attribute domain module.

1 For a more practically useful example, see the d4p_renditionTarget attribute domain in the DITA For Publishers vocabulary.