Constraints
Constraint modules define additional
constraints for vocabulary modules in order to restrict
content models or attribute lists for specific element
types, remove certain extension elements from an integrated
domain module, or replace base element types with
domain-provided, extension element types.
Overview of constraints Constraint modules enable information architects to restrict the content models or attributes of OASIS-defined DITA grammars. A constraint is a simplification of an XML grammar such that any instance that conforms to the constrained grammar also will conform to the original grammar.
Constraint rules There are certain rules that apply to the design and implementation of constraints.
Constraints, processing, and interoperability Because constraints can make optional elements required, documents that use the same vocabulary modules might have incompatible constraints. Thus the use of constraints can affect the ability for content from one topic or map to be used in another topic or map.
Weak and strong constraints Constraints can be classified into two categories: Weak and strong. This classification determines whether processors enforce strict compatibility during @conref
or @conkeyref
resolution.
Conref compatibility with constraints To determine compatibility between two document instances, a conref processor checks the @domains
attribute to confirm whether the referencing document has a superset of the vocabulary modules in the referenced document. If one or both of the document instances are constrained, the conref processor checks to confirm the compatibility of the constraints.
Examples: Constraints This section of the specification contains examples and scenarios. They illustrate a variety of ways that constraints can be used; they also provide examples of the DTD coding requirements for constraints and how constraints are integrated into document-type shells.