Example: Constrain a domain module
In this scenario, an information architect wants to use only a subset of the elements
defined in the highlighting domain. She wants to use <b>
and
<i,>
but not <line-through>
,
<overline>
, <sup>
, <sup>
,
<tt>
, or <u>
. She wants to integrate this
constraint into the document-type shell for task.
Example
- She creates reducedHighlightingDomainConstraint.mod, where "reduced" is a string that characterizes the constraint.
- She adds the following content to reducedHighlightingDomainConstraint.mod:
<!-- ============================================================= --> <!-- CONSTRAINED HIGHLIGHTING DOMAIN ENTITIES --> <!-- ============================================================= --> <!ENTITY HighlightingDomain-constraints "(topic hi-d basic-HighlightingDomain-c)" > <!ENTITY % HighlightingDomain-c-ph "b | i" >
- She then integrates the constraint module into her company-specific, document-type shell
for the task topic by adding the following section directly before the "DOMAIN ENTITY
DECLARATIONS"
comment:
<!-- ============================================================= --> <!-- DOMAIN CONSTRAINT INTEGRATION --> <!-- ============================================================= --> <!ENTITY % HighlightingDomain-c-dec PUBLIC "-//ACME//ENTITIES DITA Highlighting Domain Constraint//EN" "acme-HighlightingDomainConstraint.mod" >%basic-HighlightingDomain-c-dec;
- In the "DOMAIN EXTENSIONS" section, she replaces the parameter entity for the
highlighting domain with the parameter entity for the constrained highlighting
domain:
<!ENTITY % ph "ph | %HighlightingDomain-c-ph; | %sw-d-ph; | %ui-d-ph; ">
- She then adds the constraint to the list of domains and constraints that need to be
included in the value of the
@domains
attribute for<task>
:<!-- ============================================================= --> <!-- DOMAINS ATTRIBUTE OVERRIDE --> <!-- ============================================================= --> <!ENTITY included-domains "&task-att; &hi-d-att; &indexing-d-att; &pr-d-att; &sw-d-att; &ui-d-att; &taskbody-constraints; &HighlightingDomain-constraints; " >
- After updating the catalog.xml file to include the new constraints file, her work is done.