Page 1 of 1

Chunk to content and referencing a same topic

Posted: Wed Jun 14, 2023 12:12 pm
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
Attached is a small example of the problem.
chunk-introduction-issue.zip
Any idea or suggestion on this issue?

Re: Chunk to content and referencing a same topic

Posted: Wed Jun 14, 2023 1:16 pm
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

Re: Chunk to content and referencing a same topic

Posted: Wed Jun 14, 2023 2:28 pm
by gbv34
Thank you, Radu.
Indeed, using copy-to solves the issue.