Map Specialization Step 2: Create New Document Type Shell DTD

In your work area create the directories faq-map. Within faq-map create the directory dtd.

Also create the directories faq-mapDomain and faq-mapDomain/dtd. In the faq-mapDomain/dtd directory create the empty files faq-mapDomain.ent and faq-mapDomain.mod. If you want to have some content in these files you can create appropriate DTD header comments, e.g.:
<!-- ==================================
     FAQ Map Domain

     Copyright (c) 2010 Your Name Here

     ================================== -->

These stub files will allow us to create references to these modules from the faq-map document type shell before we've actually defined the faq-mapDomain module.

In the faq-map directory create the file catalog.xml with this content:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
  <nextCatalog catalog="dtd/catalog.xml"/>
  <!--<nextCatalog catalog="xsd/catalog.xml"/>-->

In the standard DITA DTD distribution, find the file base/basemap.dtd and copy it as file "faq-map/dtd/faq-map.dtd".

Edit faq-map.dtd and modify it as follows:
  1. Replace the header comment with one that reflects the new map type and your ownership.
  2. Find the comment "DOMAIN ENTITY DECLARATIONS" and after it add this parameter entity declaration and reference:
    <!-- ============================================================= -->
    <!--                    DOMAIN ENTITY DECLARATIONS                 -->
    <!-- ============================================================= -->
    <!ENTITY % faq-map-d-dec 
      PUBLIC "faq-mapDomain.ent"

    Remember that we haven't created the FAQ map domain yet, so this reference currently points to a file that doesn't exist.

  3. Find the comment "DOMAIN EXTENSIONS" and delete the declaration for %topicref;.

    You are deleting the declaration for %topicref; because while we need the mapGroup domain so we can use the <keydef> element type, we will be allowing it in a specific place in the content model for <faq-map>, so we don't want it to be allowed wherever <topicref> is allowed.

    Note: Normally you would expect to add a reference %faq-question-set; here, but because the faq-map map type will depend on the faq-map domain it will be directly defining where <faq-question-set> is allowed and therefore we don't want to generally allow <faq-question-set> anywhere <topicref> is allowed.
  4. Find the declaration for the %map-type; parameter entity and add this declaration after it:
    <!ENTITY % map-type     
    <!ENTITY % faq-map-type     
      PUBLIC "fap-map.mod" 
  5. Find the comment "DOMAIN ELEMENT INTEGRATION" and add this parameter entity declaration and reference:
    <!-- ============================================================= -->
    <!--                    DOMAIN ELEMENT INTEGRATION                 -->
    <!-- ============================================================= -->
    <!ENTITY % faq-map-d-def
      PUBLIC "faq-mapDomain.mod"
  6. In the faq-map directory create a new XML document named fap-map-test-01.ditamap and give it this content:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faq-map 
      PUBLIC "faq-map" "dtd/faq-map.dtd">
      <title>FAQ Map Test 01</title>

    Validate the document. It should fail with a message to the effect that it cannot find the file "faq-map.mod".

At this point you have what should be a good document type shell and a document that uses it.

The next step is to implement the faq-map type module.