Map Specialization Step 2: Create New Document Type Shell DTD
In your work area create the directory faq-map. Within faq-map create the directory dtd.
<!-- ================================== FAQ Map Domain Copyright (c) 2011 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.
<?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"/>--> </catalog>
In the standard DITA DTD distribution, find the file base/basemap.dtd and copy it as file faq-map/dtd/faq-map.dtd.
- Replace the header comment with one that reflects the new map type and your ownership.
- 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" "../../faq-mapDomain/dtd/faq-mapDomain.ent" >%faq-map-d-dec;
Remember that we haven't created the FAQ map domain yet, so this reference currently points to a file that doesn't exist.
- 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. - Find the declaration for the
%map-type;
parameter entity and add this declaration after it:<!ENTITY % map-type PUBLIC "-//OASIS//ELEMENTS DITA 1.2 Map//EN" "map.mod" >%map-type; <!ENTITY % faq-map-type PUBLIC "fap-map.mod" "fap-map.mod" >%faq-map-type;
- 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" "../../faq-mapDomain/dtd/faq-mapDomain.mod" >%faq-map-d-def;
- 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"> <faq-map> <title>FAQ Map Test 01</title> </faq-map>
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.