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:
Create a new
entfile defining the specialized attributebase-orprops.Reference the new
entfile 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:
Create a new
entfile calledherstellerDomain.ent.Add the following two declarations to the
herstellerDomain.entfile:
<!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:
Copy the
concept.dtdfile and give the copy a new name, for examplespecial_concepts.dtd.Find the section
DOMAIN ATTRIBUTE DECLARATIONSin thespecial_concepts.dtdfile.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.entfile.
In the section
DOMAIN ATTRIBUTE EXTENSIONS, add the following entry:
<!ENTITY % props-attribute-extensions "%herstellerprops-attribut;" >Here,
%hersteller-props-attributis the parameter entity name as defined in theherstellerDomain.entfile. This entry adds the attributeherstellerto the parameter entity%selection-atts, which in turn belongs to the parameter entity%univ-atts. DITA’s parameter entity%selection-attscontains the definitions of conditional processing attributes. The parameter entity%univ-attsdefines attributes available in practically all elements.
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 theherstellerDomain.entfile and ishersteller-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.
Copyright © 2008 XLcontent Verlag
You may print the online version for your private use.
Otherwise, this chapter from “DITA - Der neue Standard für Technische Dokumentation” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
XLcontent Verlag, Pflegerstraße 40, 81247 München
back to top