context-help-map has duplicate entries

Post here questions and problems related to editing and publishing DITA content.
Micaela Monroe
Posts: 29
Joined: Mon May 17, 2021 8:20 pm

context-help-map has duplicate entries

Post by Micaela Monroe »

Hi there,

I have a bookmap with references to three unique topics. One topic is reused. Two topics are pointing to each other in a reltable.

Code: Select all

<bookmap id="bm_Test">
    <booktitle>
        <mainbooktitle>Test</mainbooktitle>
    </booktitle>
    <bookmeta/>
    <chapter href="c_Concept.dita"/>
    <chapter href="tk_Task.dita"/>
    <chapter href="r_Reference.dita"/>
    <chapter href="c_Concept.dita"/>
    <reltable>
        <relheader>
            <relcolspec/>
            <relcolspec/>
        </relheader>
        <relrow>
            <relcell>
                <topicref href="r_Reference.dita"/>
            </relcell>
            <relcell>
                <topicref href="tk_Task.dita"/>
            </relcell>
        </relrow>
    </reltable>
When I generate webhelp and I open the resulting context-help-map.xml file, I see duplicate entries for the reused topic and the topics referenced in the reltable. I would expect one entry per topic. Is this expected behavior? If so, is there a way for me to turn off the duplication?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<map>
   <appContext helpID="c_Concept" path="c_Concept.html"/>
   <appContext helpID="tk_Task" path="tk_Task.html"/>
   <appContext helpID="r_Reference" path="r_Reference.html"/>
   <appContext helpID="c_Concept" path="c_Concept.html"/>
   <appContext helpID="r_Reference" path="r_Reference.html"/>
   <appContext helpID="tk_Task" path="tk_Task.html"/>
</map>
Thanks!
Micaela
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: context-help-map has duplicate entries

Post by chrispitude »

Hi Micaela,

WebHelp publishing does not make any attempt to suppress entries to different files that have the same ID. But interestingly, your multiple entries are pointing to the same files.

I noticed you have this line twice:

Code: Select all

    <chapter href="c_Concept.dita"/>
If you remove the second instance, does the issue get resolved?

- Chris
Micaela Monroe
Posts: 29
Joined: Mon May 17, 2021 8:20 pm

Re: context-help-map has duplicate entries

Post by Micaela Monroe »

Hi,

If I remove the second instance of the same topic, or if I remove references to those topics from the reltable, the repetition doesn't happen. Unfortunately, we can't do either in a map with real content.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookmap PUBLIC "-//Jeppesen//DTD Jeppesen DITA BookMap//EN" "jeppBookmap.dtd">
<bookmap id="bm_Test">
    <booktitle>
        <mainbooktitle>Test</mainbooktitle>
    </booktitle>
    <bookmeta/>
    <chapter href="c_Concept.dita"/>
    <chapter href="tk_Task.dita"/>
    <chapter href="r_Reference.dita"/>
  <!--  <chapter href="c_Concept.dita"/>
    <reltable>
        <relheader>
            <relcolspec/>
            <relcolspec/>
        </relheader>
        <relrow>
            <relcell>
                <topicref href="r_Reference.dita"/>
            </relcell>
            <relcell>
                <topicref href="tk_Task.dita"/>
            </relcell>
        </relrow>
    </reltable>-->
</bookmap>

Code: Select all

<map>
   <appContext helpID="c_Concept" path="c_Concept.html"/>
   <appContext helpID="tk_Task" path="tk_Task.html"/>
   <appContext helpID="r_Reference" path="r_Reference.html"/>
</map>
Thanks,
Micaela
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: context-help-map has duplicate entries

Post by radu_pisoi »

Hi,

I think there are two case:
1. Topics that are referenced in the relationship table. For these topics, there should no entry generated in the context-help-map.xml file.
2. Duplicate references of the same topic in map, like c_Concept.dita. For this case, it is recommended to use copy-to attribute to create a duplicate version of the HTML topic. Otherwise,the navigation links will not work as expected.

Code: Select all

<topicref href="c_Concept.dita" copy-to="c_Concept_2.dita">
        <topicmeta>
            <resourceid appid="c_Concept_2"></resourceid>
        </topicmeta>
</topicref>
For the above example, the following entry should be generated in the context-help-map.xml file

Code: Select all

<appContext helpID="c_Concept_2" path="c_Concept_2.html"/>
Unfortunately, this not happen in the current WebHelp version.

I have added an issue in our internal issues tracker for both situations: WH-3167.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Micaela Monroe
Posts: 29
Joined: Mon May 17, 2021 8:20 pm

Re: context-help-map has duplicate entries

Post by Micaela Monroe »

Thanks Radu!
Post Reply