Add references to sections in the table of contents

Post here questions and problems related to editing and publishing DITA content.
ekb
Posts: 2
Joined: Fri Jan 25, 2019 1:13 pm

Add references to sections in the table of contents

Post by ekb »

Hi!
I want to create a large topic with many sections, is it possible to somehow reference these sections in a ditamap to be displayed in table of contents as if they were separate topics? For example, this is the topic:

Code: Select all

<reference id="tocsec" xml:lang="en-us">
<title>Test</title>
<shortdesc>this is a test topic</shortdesc>
<refbody>
<section id="1234">
<title>1234</title>
<p>content1</p>
</section>
<section id="2345">
<title>2345</title>
<p>content2</p>
</section>
<section>
<title>3456</title>
<p>content3</p>
</section>
</refbody>
</reference>
And I would like to have all the content published in one topic, but to make the navigation easier, I'd like to be able to access each of these sections in a table of contents, so to have TOC like this:

Test
1234
2345
3456

I'll be grateful for any hints, thanks!
Ewa
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add references to sections in the table of contents

Post by Radu »

Hi Ewa,

The DITA standard states that a DITA map can only refer to topic-like elements:

https://www.oxygenxml.com/dita/1.3/spec ... icref.html
References to DITA content cannot be below the topic level: that is, you cannot reference individual elements inside a topic.
So you would need to find another solution for this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ekb
Posts: 2
Joined: Fri Jan 25, 2019 1:13 pm

Re: Add references to sections in the table of contents

Post by ekb »

Hi Radu,

what a shame... but thanks for the info!

Regards,
Ewa
Post Reply