Map Specialization Step 3: Create faq-map Map Type Module

Find the file map.mod in the standard DITA DTD distribution. You will be cutting and pasting from map.mod into the new module file for the faq-map map type.

Construct the new module file as follows:
  1. Create the file faq-map/dtd/faq-map.mod and give it this content:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--=======================================
        FAQ Map map type module.
        
        Represents a single FAQ publication
        
        Copyright (c) 2010 Your Name Here
        
        ======================================= -->
        
        
        
     <!-- ======== End of FAQ Map Module ======  -->
  2. In map.mod find the declaration for %map.content; and copy that declaration and the next three declarations (%map.attributes; and the ENTITY and ATTLIST declarations for <map>) and paste them into the faq-map.mod file after the header comment:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--=======================================
        FAQ Map map type module.
        
        Represents a single FAQ publication
        
        Copyright (c) 2010 Your Name Here
        
        ======================================= -->
        
    <!ENTITY % map.content
                           "((%title;)?, 
                             (%topicmeta;)?, 
                             (%anchor; |
                              %data.elements.incl; |
                              %navref; |
                              %reltable; |
                              %topicref;)* )"
    >
    <!ENTITY % map.attributes
                 "title 
                            CDATA 
                                      #IMPLIED
                  id 
                            ID 
                                      #IMPLIED
                  %conref-atts;
                  anchorref 
                            CDATA 
                                      #IMPLIED
                  outputclass 
                            CDATA 
                                      #IMPLIED
                  %localization-atts;
                  %topicref-atts;
                  %select-atts;"
    >
    <!ELEMENT map    %map.content;>
    <!ATTLIST map    
                  %map.attributes;
                  %arch-atts;
                  domains 
                            CDATA 
                                      "&included-domains;" 
    >
        
        
     <!-- ======== End of FAQ Map Module ======  -->
  3. Modify these declarations by changing "map" to "faq-map" everywhere, e.g.:
    <!ENTITY % faq-map.content
                           "((%title;)?, 
                             (%topicmeta;)?, 
                             (%anchor; |
                              %data.elements.incl; |
                              %navref; |
                              %reltable; |
                              %topicref;)* )"
    >
    <!ENTITY % faq-map.attributes
     ...
    <!ELEMENT faq-map    %faq-map.content;>
    <!ATTLIST faq-map    
                  %faq-map.attributes;
      ...
    >
  4. Change the definiition of the %faq-map.content; parameter entity to:
    <!ENTITY % faq-map.content
                           "((%title;)?, 
                             (%topicmeta;)?,
                             (%keydef)*,                         
                             (%faq-question-group;),
                             (%reltable;)*)"
    >
  5. Change the value of the @domains attribute declaration in the pub-map ATTLIST declaration to reflect the module hierarchy and the required map domains:
    <!ATTLIST faq-map    
      %faq-map.attributes;
      %arch-atts;
         domains 
         CDATA 
           "(map faq-map mapGroup faq-mapDomain) 
            &included-domains;" 
    >
    
  6. Validate the test document. You should get messages the effect that the parameter entities %keydef; and %faq-question-group; were referenced but not declared.

    Because this map type module depends on specific domains, we have to locally declare the parameter entities for those element types we use from the domains because the domain-provided parameter entities are not included by the shell DTD until after the map type module is included.

  7. Immediately after the header comment, add these parameter entity declarations:
    <!ENTITY % keydef           "keydef"           >
    <!ENTITY % faq-question-set "faq-question-set" >

    Validate the test document again. It should now give a message that the document is missing required content.

  8. Edit the test document to add the minimum allowed content, resulting in this document:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faq-map 
      PUBLIC "faq-map" "dtd/faq-map.dtd">
    <faq-map>
      <title>FAQ Map Test 01</title>
      <topicmeta></topicmeta>
      <keydef keys="foo"/>  
      <faq-question-set>
        
      </faq-question-set>
    </faq-map>

    Validate the test document again. It should now complain that the element type <faq-question-set> is not declared, which of course it is not.

  9. Immediately before the ending comment, add the @class attribute declaration for the <faq-map> element:c
    <!ATTLIST faq-map    %global-atts;  class CDATA "- map/map faq-map/faq-map "        >

At this point the faq-map map type should be ready to use as soon as the faq-mapDomain module is defined.