Page 1 of 1

context-help-map has duplicate entries

Posted: Fri May 19, 2023 11:33 pm
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

Re: context-help-map has duplicate entries

Posted: Sat May 20, 2023 8:20 pm
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

Re: context-help-map has duplicate entries

Posted: Mon May 22, 2023 5:20 pm
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

Re: context-help-map has duplicate entries

Posted: Tue May 23, 2023 12:16 pm
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.

Re: context-help-map has duplicate entries

Posted: Tue May 23, 2023 5:35 pm
by Micaela Monroe
Thanks Radu!