Hi,
We have a use case for which we use <xref> with keyref attribute.
<keydef href="topics/task/topic-name.dita" keys="topic-name"/> --> Defined in ditamap
<xref keyref="guide-name.topic-name">Link to another topic</xref> --> Inside topic
This link is resolved properly in DITA-OT XHTML and HTML5 output. However, when I give link to a sub-topic in it, then the link is resolved incorrectly.
Here is our test case. We gave links to an image and a subtopic from a topic using xref with keyref.
Link 1:
<xref keyref="guide-name.topic-name/my-graph-picture">Link to image in another topic</xref> --> This is resolved into <a class="xref" href="topic-name.html#topic-root-id__my-graph-picture">Link to image in another topic</a>. Also, the id for the image is set to "topic-root-id__my-graph-picture". So, it is working
fine.
Link 2:
<xref keyref="guide-name.topic-name/my-sub-topic">Link to sub-topic</xref> --> This is resolved into <a class="xref" href="topic-name.html#topic-root-id__my-sub-topic">Link to sub-topic</a>. But the id for the sub-topic (concept/concept) is set to "
my-sub-topic". So the link is broken. I have checked this behavior in DITA-OT 3.5.2.
I understand that the links using keyrefs are not completely supported; but this seems like an inconsistency to me.
Thank you.
Best Regards,
Uma Shankar