Map Specialization Step 4: Create faq-mapDomain Module
The faq-mapDomain map domain defines the <faq-question-set>
and <faq-question>
topicref types.
Create the module as follows:
- Edit the file faq-mapDomain/dtd/faq-mapDomain.ent and add these declarations:
<!-- ============================================================= --> <!-- ELEMENT EXTENSION ENTITY DECLARATIONS --> <!-- ============================================================= --> <!ENTITY % faq-map-d-topicref "faq-question-set | faq-question " > <!-- ============================================================= --> <!-- DOMAIN ENTITY DECLARATION --> <!-- ============================================================= --> <!ENTITY faq-map-d-att "(map faq-map-d)" >
- Edit the file faq-mapDomain/dtd/faq-mapDomain.mod and add these parameter entity declarations:
<!-- ================================== FAQ Map Domain Copyright (c) 2011 Your Name Here ================================== --> <!ENTITY % faq-question-set "faq-question-set" > <!ENTITY % faq-question "faq-question" >
- In the file map.mod find the declarations for the
<topicref>
element and copy them into the faq-mapDomain.mod file:<!ENTITY % topicref.content "((%topicmeta;)?, (%anchor; | %data.elements.incl; | %navref; | %topicref;)* )" > <!ENTITY % topicref.attributes "navtitle CDATA #IMPLIED href CDATA #IMPLIED keyref CDATA #IMPLIED keys CDATA #IMPLIED query CDATA #IMPLIED copy-to CDATA #IMPLIED outputclass CDATA #IMPLIED %topicref-atts; %univ-atts;" > <!ELEMENT topicref %topicref.content;> <!ATTLIST topicref %topicref.attributes;>
- Globally change "topicref" to "faq-question-set," except for the reference to
the
%topicref.atts;
parameter entity:<!ENTITY % faq-question-set.content "((%topicmeta;)?, (%anchor; | %data.elements.incl; | %navref; | %faq-question-set;)* )" > <!ENTITY % faq-question-set.attributes "navtitle CDATA #IMPLIED href CDATA #IMPLIED keyref CDATA #IMPLIED keys CDATA #IMPLIED query CDATA #IMPLIED copy-to CDATA #IMPLIED outputclass CDATA #IMPLIED %topicref-atts; %univ-atts;" > <!ELEMENT faq-question-set %faq-question-set.content;> <!ATTLIST faq-question-set %faq-question-set.attributes;>
- Change the content model for
<faq-question-set>
to:<!ENTITY % faq-question-set.content "((%topicmeta;)?, (%faq-question;)*)" >
- Copy the declarations for
<faq-question-set>
and paste them after the ATTLIST declaration for<faq-question-set>
. Change "faq-question-set" to "faq-question":<!ENTITY % faq-question.content "((%topicmeta;)?, (%faq-question;)*)" > <!ENTITY % faq-question.attributes "navtitle CDATA #IMPLIED href CDATA #IMPLIED keyref CDATA #IMPLIED keys CDATA #IMPLIED query CDATA #IMPLIED copy-to CDATA #IMPLIED outputclass CDATA #IMPLIED %topicref-atts; %univ-atts;" > <!ELEMENT faq-question %faq-question.content;> <!ATTLIST faq-question %faq-question.attributes;>
- Change the content model for
<faq-question>
to:<!ENTITY % faq-question.content "((%topicmeta;)?)" >
- From map.mod find the
@class
attribute declaration for@topicref
and paste it into faq-mapDomain.mod.<!ATTLIST topicref %global-atts; class CDATA "- map/topicref " >
- Change the element type from "topicref" to "faq-question," change the "-"
to "+," and add " faq-map-d/faq-question " to the end of the attribute
value:
<!ATTLIST faq-question %global-atts; class CDATA "+ map/topicref faq-map-d/faq-question " >
- Validate the test document. It should validate. Verify that you can add a
<faq-question>
topicref within<faq-question-set>
.
You're done. The FAQ map type and map domains have been declared and validated. All that remains is adding the appropriate catalog entries, updating the faq-map document type shell to use the public IDs for the module files, and packaging the lot as one or more Toolkit plugins.