Page 1 of 1

Auto generating collection from ditamap

Posted: Thu Mar 29, 2012 4:57 pm
by SimonH
Hi,

I am trying to auto-generate a list of topics from the ditamap after a brief introduction paragraph.

I have created 3 files.


<concept id="concept_y1k_rdj_tf">
<title>Introduction</title>
<shortdesc>This is the introduction</shortdesc>
<conbody>
<p>There are 2 types.</p>
</conbody>
</concept>

<concept id="concept_tjs_sdj_tf">
<title>Type 1</title>
<shortdesc>This is type 1</shortdesc>
<conbody>
<p>Concept definition.</p>
</conbody>
</concept>

<concept id="concept_jgf_5dj_tf">
<title>Type 2</title>
<shortdesc>This is type 2.</shortdesc>
<conbody>
<p>Concept definition.</p>
</conbody>
</concept>

I want the generated output to append the title and shortdesc of type 1 and type 2 topics to the introduction as an unordered list.

e.g.

--
Introduction.

This is the introduction

There a 2 types.

[] Type 1
This is type 1

[] Type 2
This is type 2
--

I created a ditamap file and set the collection-type="unordered".

<map>
<title>DITA Topic Map</title>
<topicref href="Intro.dita" collection-type="unordered">
<topicref href="Type1.dita"/>
<topicref href="Type2.dita"/>
</topicref>
</map>

However, the generated HTML or PDF file does not include the appended list?

Any help please?
Simon

Re: Auto generating collection from ditamap

Posted: Thu Mar 29, 2012 5:13 pm
by Radu
Hi Simon,

You can find a description for the collection-type in the DITA 1.2 specs:

http://docs.oasis-open.org/dita/v1.2/os/spec/common/topicref-atts.html

The values of this attribute actually specify to the publishing engine (DITA Open Toolkit in the case of Oxygen) whether to add certain links between the topics. The default value for the attribute is unordered.

I do not think that what you want can be achieved using topicrefs without customizing a considerable amount of stylesheets.

Maybe you can also ask around on the DITA Users List, they might have a solution for you.

Regards,
Radu

Re: Auto generating collection from ditamap

Posted: Fri Mar 30, 2012 10:22 am
by SimonH
Thanks for your response.

I was reading the following book:

http://www.scriptorium.com/books/the-di ... r-authors/

It suggested not to create stem topics manually using x-ref but that the stucture should be in the ditamap and the list for the step topic created automatically using the collection-type attribute.

I was therefore supprised that the default implementation didn't do anything with these attributes. Has anyone else written custom output to automatically generate the links?

Re: Auto generating collection from ditamap

Posted: Fri Mar 30, 2012 11:26 am
by Radu
Hi Simon,

Fortunately I also have access to the DITA Style Guide :)
I think that what Tony Self means is that you can use this attribute:

Code: Select all

collection-type="family"


on the parent topic ref and indeed the DITA OT will generate in the parent topic's HTML content links to its child topics.

Regards,
Radu