Step 2-4. Declare FAQ Question Topic Type Elements and Attributes
Per our markup design from step 1, we will need to declare the following specialized
element types:
<faq-question>
as a specialization of<concept>
<faq-question-statement>
as a specialization of<title>
<faq-answer>
as a specialization of<conbody>
To create these new element types, edit the faq-question.mod file and
modify it as follows:
- Find the declaration for the
<concept>
element type. Change "concept" to "faq-question" in the element and attribute list declarations. - Within the content model for what is now
<faq-question>
, change "%title;" to "%faq-question-statement;" and "%conbody;" to "%faq-answer;." - Find the declaration for the
<conbody>
element type. Change "conbody" to "faq-answer" in the element and attribute list declarations. - From the base DITA distribution, open commenElements.mod
and find the declaration for the
<title>
element. Copy this declaration and paste it into faq-question.mod. Change "title" to "faq-question-statement" in the element and attribute list declarations.
The element type declarations should look like this:
<!-- LONG NAME: FAQ question --> <!ENTITY % faq-question.content " ((%faq-question-statement;), (%titlealts;)?, (%prolog;)?, (%faq-answer;)?, (%related-links;)?, (%faq-question-info-types;)* ) "> <!ENTITY % faq-question.attributes ' id ID #REQUIRED conref CDATA #IMPLIED %select-atts; %localization-atts; %arch-atts; outputclass CDATA #IMPLIED domains CDATA "&included-domains;" '> <!ELEMENT faq-question %faq-question.content; > <!ATTLIST faq-question %faq-question.attributes; > <!-- LONG NAME: FAQ answer details --> <!ENTITY % faq-answer.content " ((%body.cnt;)*, (%section;| %example;)* ) "> <!ENTITY % faq-answer.attributes ' %id-atts; %localization-atts; outputclass CDATA #IMPLIED '> <!ELEMENT faq-answer %faq-answer.content; > <!ATTLIST faq-answer %faq-answer.attributes; > <!-- LONG NAME: FAQ question statement --> <!ENTITY % faq-question-statement.content " (%title.cnt;)* "> <!ENTITY % faq-question-statement.attributes ' %id-atts; %localization-atts; outputclass CDATA #IMPLIED '> <!ELEMENT faq-question-statement %faq-question-statement.content; > <!ATTLIST faq-question-statement %faq-question-statement.attributes; >
If you want, validate the test document again. You should now only get errors like
"parameter entity 'question-statement' was referenced but not declared" and
maybe some errors about the declaration of <faq-question>
itself. This
indicates we've declared the necessary element types, at least minimally, but we need
to
declare the parameter entities as well.