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.
A constraint module can perform the following functions:
<topic>
can require <shortdesc>
, can remove
<abstract>
, and can require that the first child of
<body>
be <p>
. A constraint cannot allow
<shortdesc>
to follow <prolog>
, because the
content model for <topic>
requires that <shortdesc>
precedes
<prolog>
.
For example, a constraint for <note>
can limit
the set of allowed values for the @type
attribute to "note" and "tip". It also
can omit the @othertype
attribute, since it is needed only when the value of
the @type
attribute is "other".
For example, a constraint on the programming domain can reduce the
list of included extension elements to <codeph>
and
<codeblock>
.
<ph>
element with the domain-provided elements, making <ph>
unavailable.
Return to main page.
dita-v1.3-cos02-part3-all-inclusive Standards Track Work Product | Copyright © OASIS Open 2015. All Rights Reserved. | 25 November 2015 |