A given constraint definition module corresponds to exactly one topic, map, or domain vocabulary module.
Topic and map type constraint modules should be named "qualifiertagnameConstraints.xsd", where qualifier is specific to the constraints module and characterizes it, e.g. "strict", "requiredTitle", etc. and tagname is the name of the element type to which the constraints apply, e.g. "topic", "p", "myNewTopicType", etc.
Domain constraint modules should be named "qualifierdomainDomainConstraints.xsd", where qualifier is specific to the constraints module and characterizes it, e.g. "strict", "requiredTitle", etc. and domain is the name of the domain to which the constraints apply, e.g. "hi-d", "pr-d", "mydomain-d", etc.
For each extension element type in the base vocabulary module whose content model or attributes are to be constrained in the constraint module, there must be a xs:redefine element that defines the restricted content model for the base element. Attributes for an element type may be constrained as part of the redefinition of the complex type.
... <xs:redefine schemaLocation="topicMod.xsd"> <!-- constrain content of <topic> element --> <xs:complexType name="topic.class"> <xs:complexContent> <xs:restriction base="topic.content"> <xs:sequence> <xs:group ref="title"/> <xs:group ref="titlealts" minOccurs="0"/> <!-- make required --> <xs:choice> <xs:group ref="shortdesc" /> <xs:group ref="abstract" /> </xs:choice> <xs:group ref="prolog" minOccurs="0"/> <xs:group ref="body" minOccurs="0"/> <!-- remove <related-links> --> <xs:group ref="topic-info-types" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> ... </xs:redefine> ...
For selective restriction there must be a group with a subset list of extension elements for a domain in a reusable constraints module. The group name should be named "qualifierdomain-c-tagname" where qualifier is a description for the constraint vocabulary constraint module file, domain is the name of the domain, map, or topic being constrained, and tagname is the name of the extension element being restricted.
... <xs:group name="basicHighlight-c-ph"> <xs:choice> <xs:element ref="b"/> <xs:element ref="i"/> </xs:choice> </xs:group> ...
... <xs:include schemaLocation="basicHighlightConstraint.xsd"/> ... <xs:redefine schemaLocation="commonElementGrp.xsd"> <xs:group name="ph"> <!-- drop base <ph> as well as apply basic subset of highlight domain --> <xs:choice> <xs:group ref="basicHighlight-c-ph"/> </xs:choice> </xs:group> ... </xs:redefine> <xs:redefine schemaLocation="strictTopicConstraint.xsd"> <xs:complexType name="topic.class"> <xs:complexContent> <xs:extension base="topic.class"> <!-- declare the constraint of topic and highlight vocabulary modules and compatibility of constrained highlight with subset of topic constraints --> <xs:attribute name="domains" type="xs:string" default="(topic noBasePhrase-c) (topic strictTopic-c) (topic strictTopic-c hi-d basicHighlight-c)"/> ... </xs:extension> </xs:complexContent> </xs:complexType> ... </xs:redefine> ...
Return to main page.
DITA v1.2 CD 03
Copyright © OASIS Open 2005, 2010. All Rights Reserved.