XML Schema: Coding requirements for structural modules

An XSD structural module declares a top-level map or topic type. It is implemented as a pair of XSD documents, one that defines groups used to integrate and override the type and one that defines the element types specific to the type.

All vocabulary and constraint modules must document their @domains attribute contribution. The OASIS grammar files use a <dita:domainsModule> element to document the contribution; this element is used consistently to make it easy to find values when creating a document type shell. An XML comment or <xs:appinfo> element can also be used.

Module files

A structural vocabulary module has two files:

  • A module schema document.
  • A module group definition schema document.

Required topic and map element attributes

The root element for a structural type must reference the @DITAArchVersion attribute and the @domains attribute. These attributes give processors a reliable way to check the architecture version and look up the list of domains available in the document type. The attributes are referenced as in the following example:

<xs:attributeGroup name="concept.attributes">
  <!-- Various other attributes -->
  <xs:attribute ref="ditaarch:DITAArchVersion"/>
  <xs:attributeGroup ref="domains-att"/>
  <xs:attributeGroup ref="global-atts"/>
</xs:attributeGroup>

Controlling nesting in topic types

For topic modules, the last position in the content model is typically a reference to the topictype-info-types group. Document types shells can control how topics are allowed to nest by redefining the group. If topic nesting is hard coded in the structural module, and cannot be modified from the document-type shell, the topictype-info-types group is not needed.

For example, the vocabulary module for the <concept> structural type uses the group concept-info-types; this group is given a default value, and then referenced from the content model for the <concept> element type:

<xs:group name="concept-info-types">
  <xs:choice>
    <xs:group ref="concept"/>
    <xs:group ref="info-types"/>
  </xs:choice>
</xs:group>

<xs:group name="concept.content">
  <xs:sequence>
    <xs:group ref="title"/>
    <!-- ...other elements, such as shortdesc and body, and then... -->
    <xs:group ref="related-links" minOccurs="0"/>
    <xs:group ref="concept-info-types" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:group>

Was this helpful?