Example: Replace a base element with the domain extensions

In this scenario, an information architect wants to remove the <ph> element but allow the extensions of <ph> that exist in the highlighting, programming, software, and user interface domains.

Example

  1. The information architect creates an entities file named noPhConstraint.ent, where "no" is a qualifier string that characterizes the constraint.
  2. The information architect adds the following content to noPhConstraint.ent:
    <!-- ============================================================= -->
    <!--      CONSTRAINED HIGHLIGHTING DOMAIN ENTITIES                 -->
    <!-- ============================================================= -->
    
    <!ENTITY ph-constraints     
      "(topic noPh-ph-c)"
    >
    Note: Because the highlighting and programming domains cannot be generalized without the <ph> element, this entity must be defined so that there is a separate parenthetical expression that can be included in the @domains attribute for the topic.
  3. The information architect then integrates the constraint module into a document-type shell for concept by adding the following section above the "TOPIC ELEMENT INTEGRATION" comment:
    <!-- ============================================================= -->
    <!--                    CONTENT CONSTRAINT INTEGRATION             -->
    <!-- ============================================================= -->
    
    <!ENTITY % noPh-ph-c-def  
      PUBLIC "-//ACME//ELEMENTS DITA Ph Constraint//EN" 
      "acme-PhConstraint-constraints" "noPhConstraint.ent">
    %noPh-ph-c-def;
  4. In the "DOMAIN EXTENSIONS" section, the information architect removes the reference to the <ph> element:
    <!-- Removed "ph | " so as to make <ph> not available, only the domain extensions. -->
    <!ENTITY % ph           "%pr-d-ph; |
                             %sw-d-ph; | 
                             %ui-d-ph;
                            ">
  5. She then adds the constraint to the list of domains and constraints that need to be included in the value of the @domains attribute:
    <!-- ============================================================= -->
    <!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
    <!-- ============================================================= -->
    
    <!ENTITY included-domains 
                              "&concept-att;
                               &hi-d-att; 
                               &indexing-d-att;
                               &pr-d-att; 
                               &sw-d-att;
                               &ui-d-att;
                               &ph-constraint;
      "
    >
  6. After updating the catalog.xml file to include the new constraints file, the information architect's work is done.