xsddita

What does mapmod means in DITA


I am new to DITA world and looking at the DITA 1.3 I found we have map.xsd, topic.xsd...etc. But at the same time there's mapMod.xsd, topicMod.xsd...etc.

What does the "mod" stand for? What's the difference between map and mapmod (topic and topicmod)?

Also map vs mapGrp vs mapGroupMod


Solution

  • What does the "mod" stand for? What's the difference between map and mapmod (topic and topicmod)?

    'Mod' just stands for 'module' where the word 'module' here is used to just refer XML Schema definitions that are linked together by xs:import or xs:redefine in the same file. If you take a look at mapmod.xsd there's a comment at the top of the file:

    <!-- MODULE: DITA MAP XSD Module -->
    

    In map.xsd, it imports mapmod.xsd:

    <xs:redefine schemaLocation="mapMod.xsd">
    

    It's basically a way to break up schemas into smaller components, with the added benefit that those components can be re-usable. mapmod.xsd is also imported by bookmap.xsd.

    The same with topic.xsd that imports topicMod.xsd:

    <xs:redefine schemaLocation="topicMod.xsd">
    

    NOTE: xs:redefine is similar to xs:import but it also allows overriding a schema definition for a complexType or group or attributeGroup so long as the namespaces are the same.

    Also map vs mapGrp vs mapGroupMod

    The mapGrp.xsd file is so named (with 'Grp' in the filename) because it contains only xs:group definitions, and again is a schema file that is also imported by bookmap.xsd.

    mapGroupMod.xsd contains both xs:group, xs:attributeGroup, xs:element definitions that are related, hence are in the same file (i.e a module). If you look inside mapGroupMod.xsd there's a comment:

    <!--PURPOSE:    Define elements and specialization attributes    -->
    <!--            for Map Group Domain                             -->
    

    'Map group' refers the conceptual grouping of XML elements that make up a map in the DITA spec: https://docs.oasis-open.org/dita/v1.2/os/spec/common/map_elements.html

    map.xsd essentially is the schema file that brings it all together, as it imports mapMod.xsd and mapGroupMod.xsd.

    NOTE: The above links are for an older version of DITA, it may not match the version you have, I linked to them as they are online as a convenient reference.