Creating maps

In this topic you will create a map to aggregate the topics you created in the previous chapter. The map is based on a template already provided. The map file includes topicrefs to the topics you want to aggregate, process, and publish, and also a relationship table to link the included topics in a meaningful way. You will be working in the MY_DITA_SOURCE/samples/groceryshopping directories. This topic assumes you are familiar with the information in About the grocery shopping sample, and that you have created the topics according to the instructions in Topics.
  1. Go to the groceryshopping/template directory.
  2. Copy the groceryshopping_map.ditamap file to the working directory .
  3. Using your authoring tool, open the "working" version of groceryshopping_map.ditamap. Your working map file initially looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "../dtd/map.dtd">
    <!-- This is a template file -->
    <!-- The "groceryshopping" topic page is a mini-toc for 
    the concept, task, and reference pages, 
    which are displayed sequentially. 
    You could display those pages in any order. -->
    <map title="Grocery shopping">
    <topicref href="topics/groceryshopping.dita" type="topic">
    <!-- The concept, task, and reference topicrefs go here -->
    </topicref>
    <!-- The relationship table goes below -->
    <!-- The related concept, task, 
              and reference files point to each other -->
    </map>
    				
  4. Add nested topicrefs for your concept, reference and task files. The topicref section of your file should look like this:
    <topicref href="topics/groceryshopping.dita" type="topic">
    <topicref href="concepts/about_produce.dita" type="concept"/>
    <topicref href="concepts/about_cannedgoods.dita" type="concept"/>
    <topicref href="tasks/choosing_produce.dita" type="task"/>
    <topicref href="tasks/buying_cannedgoods.dita" type="task"/>
    <topicref href="reference/produce.dita" type="reference"/>
    <topicref href="reference/cannedgoods.dita" type="reference"/>
    </topicref>
    				
    The concepts, tasks, and reference topics will all be nested within the groceryshopping topic. Notice how nesting is accomplished: the closing topicref tag for the groceryshopping topic appears below the topicref for cannedgoods.
  5. Below the relationship table comment lines, add a relationship table linking your produce and canned goods topics together. The relationship table section of your file should look like this:
    <!-- Relationship table -->
    <!-- The related concept, task, and reference files point to each other -->
    <reltable>
    <relheader>
    <relcolspec type="concept"/>
    <relcolspec type="task"/>
    <relcolspec type="reference"/>
    </relheader>
    <relrow>
    <relcell>
    <topicref href="concepts/about_produce.dita"/>
    </relcell>
    <relcell>
    <topicref href="tasks/choosing_produce.dita"/>
    </relcell>
    <relcell>
    <topicref href="reference/produce.dita"/>
    </relcell>
    </relrow>
    <relrow>
    <relcell>
    <topicref href="concepts/about_cannedgoods.dita"/>
    </relcell>
    <relcell>
    <topicref href="tasks/buying_cannedgoods.dita"/>
    </relcell>
    <relcell>
    <topicref href="reference/cannedgoods.dita"/>
    </relcell>
    </relrow>
    </reltable>
    				
    Because we have concept, task, and reference information for each "topic" (the topics would be "canned goods" and "produce") in our document, we have chosen a three-column table that links all the topics about canned goods, and also links all the topics about produce. There are other ways to design a relationship table.
  6. Save the changed file.
  7. If you have problems creating or validating your working file, compare it with the file by the same name in the completed directory.