Topic Constraint Module Step 2: Declare The @domains Attribute Text Entity

Like vocabulary modules, constraint modules must be declared in the @domains attribute of each top-level map or topic file that uses the constraint.

Constraint modules are indicated by names of the form "moduleName-c", e.g., "highlightOnlyTopic-c". As for vocabulary modules, you declare a text entity that holds the @domains attribute contribution. This entity is named "tagname-constraints", reflecting the fact that there can be at most one constraint module for a given element type in a given document type shell.

For the highlight-only constraint module, add the declaration shown to the highlightOnlyTopicConstraint.mod file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================
     Constraint Domain: Paragraphs with
     only highlight domain elements.
     
     Copyright (c) 2010 Your Name Here
     
     ====================================== -->

<!ENTITY topic-constraints "(topic highlightOnlyTopic-c)" >
     
<!-- ============ End of constraint module -->

What do you do if you have multiple constraint modules for a given element type that you want to use together?

In that case you must create a new constraint module that combines the multiple constraint modules together. For example, if someone gave you another topic constraint module that constrained a different element type, you would combine those declarations with the declarations in the highlight-only topic constraint module.

When the two constraints constrain different element types then combining them is easy: just copy all the declarations from one constraint module into the other and save the result as a new file with a new module name.

If the constraints constrain the same element types then you must work out how the constraints should be combined in order to create a new constraint module.