Creating a MAP of distinct MAPs

Questions about XML that are not covered by the other forums should go here.
Posts: 4

Creating a MAP of distinct MAPs

Wed Sep 07, 2016 10:16 pm

Hi everyone,

I've got a problem that I've been tinkering with and am having difficulty getting the output I am looking for. I am hoping the experts have some advice.

My situation is pretty simple:

I have a bunch of MAPs (let's say 20 MAPs) that stand on their own to create documents.

I would like to create a master MAP in which I could insert all of these MAPs to create an output that, more or less, produces a PDF that, in this case, contains 20 top level items - 1 for each MAP.

What I'm coming up against is that when the MAP is created it just renders/includes the topics that are contained within the MAPs. Thus, my PDF looks like one big book of topics when I'd like to have a big book of smaller, clearly distinguishable books.

For example, let's say:

I have a MAP called "Test MAP" that contains two topics: Test A and Test B.
I have another MAP called "The other MAP" that contains two topics: Other A and Other B.

When I pull these two MAPs into a master MAP and create the PDF, I see the contents as being:

Test A
Test B
Other A
Other B

When I would like them to be:

Test MAP
->Test A
->Test B
The other MAP
->Other A
->Other B

Is this possible? If so, what am I missing?

Thanks in advance for any advice!
Site Admin
Posts: 132

Re: Creating a MAP of distinct MAPs

Thu Sep 08, 2016 11:15 am


The behavior you have encountered is correct. The DITA 1.2 specification for "mapref" states that:
The hierarchy of the referenced map is merged into the container map at the position of the reference, and the relationship tables of the child map are added to the parent map.


To achieve your desired output you may consider wrapping the map references into "topichead" elements, specifying a "navtitle" for each of them.
For example:

Code: Select all

    <topichead navtitle="Test Map">
        <mapref href="maps/testMap.ditamap"/>
    <topichead navtitle="The other Map">
        <mapref href="maps/theOtherMap.ditamap"/>

Unfortunately you will not obtain individual tables of contents at the beginning of each inner map. There will be a single table of contents for the master map.

Alin Balasa
Software Developer
<oXygen/> XML Editor
Posts: 4

Re: Creating a MAP of distinct MAPs

Thu Sep 08, 2016 2:01 pm

Hi Alin, and thanks for your reply.

As luck would have it, I came back to report that I had the same thought as you describe. It occurred to me that this would be the expected behavior (not sure why I stumbled on that). Once I realized that, I did exactly as you describe and it produced satisfactory output. I'm comforted to know that I'm not too far off base. :)

Again, thanks very much for your reply. Have a great day.

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 1 guest