xmlditaoxygenxmldita-ot

DITA OT returns flat topic structure


I am having issues in DITA getting the structure I want using the open toolkit.

My bookmap contains chapters which reference DITA maps.

<chapter class="- map/topicref bookmap/chapter " format="ditamap" href="001.1_X00344819.ditamap" navtitle="Introduction"/>

The maps then reference other maps or topics.

<topicref class="- map/topicref " format="dita" href="002.1_X00176947.dita"
    navtitle="Measurements" type="concept"/>
<topicref class="- map/topicref " format="ditamap" href="002.1_X00310578.ditamap"
    navtitle="Symbols and iconography"/>

Opening the bookmap in the Oxygen map editor with resolved topics, I get the structure I want:

However, if I use the open toolkit (3.4.1 in Oxygen, or 3.5.4-external) I get just the topics with no hierarchy.

In the output for normalized-DITA, the content of the chapters and maps are copied (excluding the titles), and the topicrefs (to topics) have become chapters:

<chapter format="dita" navtitle="Measurements" type="concept" href="002.1_X00176947.dita">
    <topicmeta>
        <navtitle>Measurements</navtitle>
        <linktext>Measurements</linktext>
    </topicmeta>
</chapter>
<chapter format="dita" navtitle="Mandatory action signs" type="reference"
    href="002.1_X00310580.dita">
    <topicmeta>
        <navtitle>Mandatory action signs</navtitle>
        <linktext>Mandatory action signs</linktext>
    </topicmeta>
</chapter>
<chapter format="dita" navtitle="Warning signs" type="reference" href="002.1_X00313315.dita">
    <topicmeta>
        <navtitle>Warning signs</navtitle>
        <linktext>Warning signs</linktext>
    </topicmeta>
</chapter>

Given it is happening with two versions of the OT I am assuming it is something I am doing wrong, but what?


Solution

  • The problem is with your markup. DITA maps do not contribute to hierarchy; only elements and specializations of elements contribute to hierarchy.

    If you want a DITA map to generate a chapter titled "Introduction" with child topics, you'll need to use the following markup:

    <map><title>Introduction</title>
    <topichead>
      <topicmeta>
        <navtitle>Introduction</navtitle>
      </topicmeta>
      <topicref .../>
      <topicref .../>
    </topichead>
    </map>