Chunk to content and referencing a same topic

Post here questions and problems related to editing and publishing DITA content.
gbv34
Posts: 105
Joined: Thu Jan 20, 2022 12:36 pm

Chunk to content and referencing a same topic

Post by gbv34 »

Hello there!
I stumbled upon a strange situation.
I have a map with a parent topic which chunks a subtopic.

Code: Select all

<map>
    <title>Mathematics</title>
    <topicref href="introduction.dita"/>
    <topicref href="parent.dita" chunk="to-content" >
        <topicref href="introduction.dita"/>
    </topicref>
</map>
If I reference the topic Introduction above and solely, it seems the rendering displays this topic with the content of the parent.dita topic as well.
I did tests with a generic OT and got the same result. Actually, I would expect to see the first reference of the introduction topic without the content of the parent topic referenced after.
In this screenshot, one sees that when accessing the introduction, I have content retrieved from the topic used below for the chunking
image.png
image.png (143.93 KiB) Viewed 374 times
Attached is a small example of the problem.
chunk-introduction-issue.zip
(1.95 KiB) Downloaded 27 times
Any idea or suggestion on this issue?
------
Gaspard
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Chunk to content and referencing a same topic

Post by Radu »

Hi Gaspard,
I can also reproduce the problem, strange, I added a DITA OT issue for it:
https://github.com/dita-ot/dita-ot/issues/4212
I think nobody has reported it before because it's quite strange to refer both directly to a topic and to have it chunked inside another one.
A possible workaround for this is to use copy-to on the first topic ref:

Code: Select all

    <topicref href="introduction.dita" copy-to="intro.dita"/>
    <topicref href="parent.dita" chunk="to-content" >
        <topicref href="introduction.dita"/>
    </topicref>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
gbv34
Posts: 105
Joined: Thu Jan 20, 2022 12:36 pm

Re: Chunk to content and referencing a same topic

Post by gbv34 »

Thank you, Radu.
Indeed, using copy-to solves the issue.
------
Gaspard
Post Reply