XML technologies / DITA / Specialization / Domain attributes

(Excerpt from “DITA – Der neue Standard für Technische Dokumentation” by Johannes Hentrich)

DITA version 1.1 introduced the ability to specialize the attribute base- and the attribute props. Both attributes are used as metadata in DITA.

The attribute props marks content to be filtered or flagged during conditional processing. Specializing the attribute props allows new conditional processing attributes to be defined in addition to the existing attributes audience, platform, importance, product, rev, otherprops and status. Further information on conditional processing is provided in “Conditional processing”.

The attribute base serves as a placeholder. Like the attribute props, it and its specializations can mark content. However, content marked with an attribute base is not considered during conditional processing.

The procedure for specializing the attribute base- and the attribute props is as follows:

  1. Create a new ent file defining the specialized attribute base- or props.

  2. Reference the new ent file in a shell DTD in which the specialized attribute should be known.

The following example shows how to specialize an attribute props. An attribute hersteller is defined to mark content associated with a particular manufacturer.

First, create an ent file defining the specialized attribute. Proceed as follows:

  1. Create a new ent file called herstellerDomain.ent.

  2. Add the following two declarations to the herstellerDomain.ent file:

<!ENTITY % hersteller-props-attribut "hersteller CDATA #IMPLIED">
<!ENTITY hersteller-d-att "a(props hersteller)">

The first <ENTITY> declaration defines the attribute hersteller. Specialized attributes of props always use the data type CDATA #IMPLIED. The same applies to specialized attributes of base.

To reference the new attribute later in a shell DTD, a parameter entity % hersteller-props-attribut is defined. In a shell DTD, the section DOMAIN ATTRIBUTE EXTENSIONS contains an entity <!ENTITY % props-attribute-extensions ""> that references the specialized attribute through the parameter entity % hersteller-props-attribut. For specialized attributes of base, a corresponding entry must be added to the shell DTD’s entity <!ENTITY % base-attribute-exten-sions "">.

The second <ENTITY> declaration assigns a name to the domain containing the specialized attribute. This name is needed in the shell DTD’s section DOMAINS ATTRIBUTE OVERRIDE. In the value of the <ENTITY> declaration, the keyword props indicates that an attribute props was specialized. When specializing the attribute base, the keyword base would be used instead. The a before the parenthesis indicates that the value is an attribute.

When specializing several attributes, it is advisable to create a separate file for each specialization. This ensures maximum modularity and improves reuse of the individual specialized domain attributes in different shell DTDs.

Next, reference the new ent file in a shell DTD. Any DITA DTD can serve as a shell DTD basis. The following uses DITA’s concept.dtd as the basis. Proceed as follows:

  1. Copy the concept.dtd file and give the copy a new name, for example special_concepts.dtd.

  2. Find the section DOMAIN ATTRIBUTE DECLARATIONS in the special_concepts.dtd file.

  3. Add the following entry to the shell DTD’s section DOMAIN ENTITY DECLARATIONS:

<!ENTITY % hersteller-d-dec SYSTEM „herstellerDomain.ent“ >
%hersteller-d-dec;

This references the herstellerDomain.ent file.

  1. In the section DOMAIN ATTRIBUTE EXTENSIONS, add the following entry:

<!ENTITY % props-attribute-extensions "%herstellerprops-attribut;" >

Here, %hersteller-props-attribut is the parameter entity name as defined in the herstellerDomain.ent file. This entry adds the attribute hersteller to the parameter entity %selection-atts, which in turn belongs to the parameter entity %univ-atts. DITA’s parameter entity %selection-atts contains the definitions of conditional processing attributes. The parameter entity %univ-atts defines attributes available in practically all elements.

  1. In the section DOMAINS ATTRIBUTE OVERRIDE, add the reference to the name of the domain containing the specialized attribute. The domain name was defined in the herstellerDomain.ent file and is hersteller-d-att.

<!ENTITY included-domains "&ui-d-att; &hi-d-att; &pr-datt; &sw-d-att; &ut-d-att; &indexing &hersteller-d-att">

In all topics created with the shell DTD special_concepts.dtd, the attribute hersteller is now available.

  

  

 

 

 

back to top