question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link to keyscoped topic not properly resolved.

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
xephon2commented, Dec 8, 2016

@raducoravu , you have to add Jarno’s dita-ot fork as a remote repository:

git remote add jelovirt https://github.com/jelovirt/dita-ot.git

Then you have to checkout his feature branch feature/keyscope_target_rewrite.

git checkout -b keyscope_target_rewrite jelovirt/feature/keyscope_target_rewrite

I’ve not tested this, but it should work.

0reactions
raducoravucommented, Nov 9, 2019

Fixed in DITA OT 3.4 with pull request #3344

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross-Book Links - Blog
This allowed keyscoped links in reused topics to always resolve properly, whether they pointed to a topic in the same book or a...
Read more >
Re: [dita] Key scopes and topicsetref
If I put a keyscope on the topicsetref references using that scope ... no way to use key references to address topics in...
Read more >
Scoped Keys in DITA 1.3 (Finally!) - IXIASOFT
Both of these maps in turn reference the topic, get_started.dita. ... On the other hand, the resolution of keys in nested key spaces...
Read more >
DITA Open Toolkit 2.2.2 Release Notes
#2180; Content references with relative paths were not properly resolved to the ... to elements in the same topic using a reference such...
Read more >
sbt Reference Manual — Combined Pages
While many users are happy with the experience, depending on the code base some of the compilation errors may be false, it may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found