Link to keyscoped topic not properly resolved.
See original GitHub issueI’m attaching a ZIP sample. improperLinkToKeyScopedTopic.zip
So, the DITA Map looks like this:
<topicgroup keyscope="product1_scope">
...........
<topicref keys="archiving" href="product1/c_archiving_mod.dita"/>
</topicgroup>
<topicgroup keyscope="product2_scope">
...............
<topicref keys="archiving" href="product1/c_archiving_mod.dita"/>
</topicgroup>
<topicref href="linking.dita"/>
Because “c_archiving_mod.dita” is referenced in two key scopes, we will have in the output file two HTMLs for it: “c_archiving_mod.html” and “c_archiving_mod-1.html”. And that’s good. The “linking.dita” should generate links to both those HTML files using fully qualified key scoped:
<p>Links <xref keyref="product1_scope.archiving"
/> to <xref keyref="product2_scope.archiving"
/>.</p>
But in the generated “linking.html” you will have both links point to the same HTML file (the one generated from the first context).
I looked a little bit in the code, the method org.dita.dost.writer.KeyrefPaser.processElement(Attributes)
resolves key references based on the current “KeyScope” map. Unfortunately the map contains these mappings:
product1_scope.archiving=product1_scope.archiving=product1/c_archiving_mod.dita
product2_scope.archiving=product2_scope.archiving=product1/c_archiving_mod.dita
although in my opinion the “product2_scope.archiving” should have been re-written (possibly in the org.dita.dost.module.KeyrefModule.execute) to point to “product1/c_archiving_mod-1.dita” because the DITA Map has already been re-written to do so.
Might also be related with #2523
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (13 by maintainers)
Top GitHub Comments
@raducoravu , you have to add Jarno’s dita-ot fork as a remote repository:
Then you have to checkout his feature branch
feature/keyscope_target_rewrite
.I’ve not tested this, but it should work.
Fixed in DITA OT 3.4 with pull request #3344