PDF: no link resolution between conrefs

Having trouble installing Oxygen? Got a bug to report? Post it all here.
nanotec
Posts: 13
Joined: Mon Mar 21, 2016 11:41 am

PDF: no link resolution between conrefs

Post by nanotec »

Hi all,
as you may already know, I'm not very familiar with DITA, so this question may feel very noobish. :)

Imagine the following scenario (see code snippets below): I have a major topic which includes two other minor topics via conref. One of the minor topics is referencing the other minor topic via xref.

If you are generating a PDF output the title of the xref target will be pulled correctly but the link isn't set (you can't click on it) and the warning "Unresolved ID reference "unique_3" found." will be generated in the console.

Major topic:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_op5_bx3_pw">
<title>Some topic</title>
<topic id="id_yc2_324_pw" conref="conref1.dita#concept_hmz_dg3_3v">
<title/>
</topic>
<topic id="id_cs5_324_pw" conref="conref2.dita#topic_jzr_wm3_pw">
<title/>
</topic>
</topic>

Minor topic 1 (holding the link)

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="concept_hmz_dg3_3v">
<title>Conref 1</title>
<body>
<p><xref href="conref2.dita#topic_jzr_wm3_pw"/></p>
</body>
</topic>
</dita>
Minor topic 2 (link target)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_jzr_wm3_pw">
<title>Conref 2</title>
<body>
<p>Text</p>
</body>
</topic>
However, this seem to work, if you change the target of the link in the "minor topic 1" file to the conref itself via

Minor topic 1 (holding the link)

Code: Select all

<xref href="major_topic.dita#id_cs5_324_pw"/>
but in this case, oXygen will show you an empty link in "Author" mode. It looks like it doesn't resolve the title of the target.

I'm not sure, if conrefs are allowed to be used in this way. So my questions are:
  • Is this a bug in DITA with xref or is it just out of the specification? Maybe conrefs aren't supposed to be used in this way.
  • Is it possible for oXygen to resolve the target so the link text in Author mode doesn't stay empty?
  • Is there another way of pulling the content in? I don't want to put both minor topics in the DITA map as a child of the major topic. If you generate HTML output of this, this will get translated into real links. As a result if you open the HTML output of the major topic file, it will just hold a title and two links. I think this is kind of confusing and is not that helpful, is it?
Any help is appreciated, thank you very much in advance, best regards
Bernhard
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF: no link resolution between conrefs

Post by Radu »

Hi Bernhard,

Actually you ask very good questions. I do not have a clear idea about how the behavior of linking between two conreffed topics should work.
It would depend on weather the publishing engine first resolves content references and then resolves links or weather its' the other way around.
The specs is not very clear about how links in conreffed content should be resolved.
If you want maybe you should register on the DITA Users List and ask the same question there, see what the DITA specification experts say about it, or I could ask the question there if you do not have an account.

Maybe in this particular case I would use chunking instead.
So I would remove the 2 conrefs from the main topic:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_op5_bx3_pw">
<title>Some topic</title>
</topic>
and my DITA Map would look something like:

Code: Select all

 <topicref href="major_topic.dita" chunk="to-content">
<topicref href="conref1.dita" toc="no"/>
<topicref href="conref2.dita" toc="no"/>
</topicref>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nanotec
Posts: 13
Joined: Mon Mar 21, 2016 11:41 am

Re: PDF: no link resolution between conrefs

Post by nanotec »

Hi Radu,
thanks for your quick reply. I didn't know the chunk-feature at all. With all your in-depth knowledge you should start writing a book, "Gems of DITA" or suchlike :wink:

I've tested the chunk-feature, but unfortunately it leads to the problem you already reported to DITA-OT issue tracker and this kind of error will confuse my colleges (even though a valid output is generated). So this is not an option at the moment. Until this issue gets fixed I'm going for a normal DITA map approach without the chunk-feature. In the PDF it doesn't make a difference, actually, only the HTML output is not that beautiful, but I can live with that for some time.
If you want maybe you should register on the DITA Users List and ask the same question there, see what the DITA specification experts say about it, or I could ask the question there if you do not have an account.
To be brutally honest with you: I have so much APIs to work with I'm happy to be only a DITA user. :) But feel free to discuss this topic with some DITA gurus, if you want to.

Thanks again for all your efforts, best regards
Bernhard
Post Reply