Page 1 of 1
Cross-reference to the same topic used in TWO DITAMAPs
Posted: Thu Jul 27, 2023 1:25 pm
by girishkanmas
OUTPUT FORMAT: XSL-FO PDF
I have reused a topic in two different DIATAMAPs in a document.
I would like to add two cross-references to the reused topic so that the respective link navigates to the intended section of the DITAMAP in the PDF.
Any help?
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Thu Jul 27, 2023 4:34 pm
by julien_lacour
Hello,
Are you publishing these ditamap separately or are they referenced in a parent one?
Could you give us more details or even a small sample showing the problem (only with the structure, the content can be random)?
Regards,
Julien
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Fri Jul 28, 2023 8:52 am
by girishkanmas
I am using both the DITAMAPs in the same BookMap.
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Fri Jul 28, 2023 11:49 am
by julien_lacour
Hello,
A solution could be to duplicate the topic and in the duplicated topic refer the content from the original topic. Each topic will be referenced in its ditamap.
Then one link will lead to the original topic while the other will lead to the duplicated one. I added a sample to make it clearer.
conref.zip
Regards,
Julien
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Mon Jul 31, 2023 11:47 am
by girishkanmas
Thank you for your solution, Julien.
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Mon Jul 31, 2023 11:49 am
by girishkanmas
Is there way we can specify the DITAMAP context in the <xref> tag for a topic reused in the same BookMap?
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Mon Jul 31, 2023 2:56 pm
by julien_lacour
Hello,
There is a possibility using @keyscope attribute on the ditamaps references in the bookmap, then using @keyref in <xref> elements.
The problem is that, to make this solution works, the topics must have a slightly different content (for example a key with the product name - the structure is the same but the displayed text differs). If not the links will lead to the first target (as they are just references to the same topic).
Regards,
Julien
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Tue Aug 08, 2023 9:17 am
by girishkanmas
Hi Julien,
I agree with you. When using DITAMAP level keyscope, TopicRef-level keys, and then Xref with keyref (scope_name.key_name), it still directs to the first instance of the topic. Therefore, I followed your first suggestion and created a new topic using Conref.
Thank you for your help.
Best regards,
Girish
Re: Cross-reference to the same topic used in TWO DITAMAPs
Posted: Fri Aug 18, 2023 10:45 am
by chrispitude
Hi Girish,
The keyscoped topics should have become unique if there was some kind of key reference in the topic. Here is a testcase that demonstrates the duplication:
oxygen_two_topic_instances.zip
Here is more information about what causes the DITA-OT to uniquify topics:
#4173: Why does a transformation sometimes create duplicate topic files?
- Chris