Integrating Attribute Domains

Attribute domains are defined in a single .ent file that defines a single parameter entity with the entity declaration and a single general text entity that provides the @@domains attribute contribution for the module.

To integrate an attribute domain into a DTD document type shell, follow the steps shown here. If you do not already have your own document type shell for the topic or map type you want to integrate with, copy the closest starting point (e.g., one of the D4P .dtd files) and then modify that. [Add reference to specialization tutorial once it is updated to DITA 1.2.]

  1. Insert a declaration for and reference to the attribute domain's .ent file.
    Look for a comment that looks like this:
    <!-- ============================================================= -->
    <!--                    DOMAIN ATTRIBUTE DECLARATIONS              -->
    <!-- ============================================================= -->
    After this comment, add an entry that looks like this (e.g., for the d4p_renditionTarget attribute domain):
    <!ENTITY % d4p_renditionTargetAtt-d-dec     
      PUBLIC "urn:pubid:dita4publishers.org:doctypes:dita:modules:d4p_renditionTargetAttDomain:entities" 
             "d4p_renditionTargetAttDomain.ent"                                                
    >
    %d4p_renditionTargetAtt-d-dec;
    
  2. Add the domain's parameter entity the %props-attribute-extensions; parameter entity.
    Find a comment that looks like this:
    <!-- ============================================================= -->
    <!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
    <!-- ============================================================= -->
    
    Immediately following that comment should be a line that looks like this:
    <!ENTITY % props-attribute-extensions "" >
    
    Between the double quotes (or before the ending double quote if there is already a value in the declaration, add a reference to the parameter entity defined in the .ent file included in the previous step. The parameter entity should be named "%attributeNameAtt-d-attribute" but you will need to look in the .ent file to make sure. The result should look like this:
    <!ENTITY % props-attribute-extensions "%d4p_renditionTargetAtt-d-attribute;" >

    Note the "%" at the start of the entity name (this is a parameter entity reference open character) and the ";" at the end (this an entity reference close character).

  3. Add a reference to the domain's @@domains attribute contribution entity to the "included-domains" general entity declaration.
    Look for a comment like this:
    <!-- ============================================================= -->
    <!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
    <!-- ============================================================= -->
    
    And then a declaration like this:
    <!ENTITY included-domains 
                            ""
    >

    Your shell may already have things inside the double quotes.

    Within the double quotes add a reference to the domains attribute component entity for the domain. This should be named like "&attributeNameAtt-d-att;" but you will need to look in the .ent file to make sure. The result should look something like this:
    <!ENTITY included-domains 
                            "
                             &d4p_renditionTargetAtt-d-att;
                            ">
    

    The line breaks within the declaration and within the double quotes don't matter. It is convenient to put each entity reference on its own line so its each to update the declaration as you add or remove domains.

    Note the "&" at the start of the entity name (this is a general entity reference open character) and the ";" at the end.

Your shell should be ready to use. How you test it depends of course on your working environment. Deployment and testing in specific tools is beyond the scope of this document.