Xref in the conkeyref'ed task fragment

44 views
Skip to first unread message

Toshihiko Makita

unread,
Nov 8, 2016, 11:18:11 AM11/8/16
to DITA-OT Users
Hi,

I’m authoring sample DITA instances for the potential user. When I use conkeyref to the task fragment that have xref to step, DITA-OT 2.3.3 reports the [DOTX032E] error and no step numbers are outputted.

[Key definition]
<keydef keys="CONNECTING_PRINTERS_STEP03"  href="collection-topics/tWhenConnectingPrintersStep03Template.dita"/>

[Conkeyref authoring]
<stepsection conkeyref="CONNECTING_PRINTERS_STEP03/stepsection_01">

[Referenced task: tWhenConnectingPrintersStep03Template.dita]
<stepsection id="stepsection_01">To configure the settings of the color measurement instrument, go to step <xref href="#./step04" format="dita" type="step"/>. Otherwise, go to step <xref href="#./step05" format="dita" type="step"/>.</stepsection>

[Error message]
[DOTX032E]: Unable to retrieve link text from target: '../collection-topics/tWhenConnectingPrintersStep03Template.dita#task_w4d_yjq_wx/step04'. If the target is not accessible at build time, or does not have a title, provide the link text inside the reference.
[DOTX032E]: Unable to retrieve link text from target: '../collection-topics/tWhenConnectingPrintersStep03Template.dita#task_w4d_yjq_wx/step05'. If the target is not accessible at build time, or does not have a title, provide the link text inside the reference.

As conkeyref only copies the referenced target, the xref to other step will not be resolved. Are there any effective authoring methods to avoid this error? Or should I remove xref from the referenced task fragment? 

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 --------------------------------------------------*/ 

Stefan Eike

unread,
Nov 8, 2016, 2:23:33 PM11/8/16
to DITA-OT Users
Dear Toshihiko Makita san,

I think you cannot use the #. selector in a content key reference, because the selector tries to find a target in the topic where it is defined, and not where it is referenced. If possible, use a qualified reference with <xref keyref="steps/step04"/>. I tested your example with DITA-OT 2.3.3 and uploaded you a working solution. Please try to provide a set of sample files, if possible. That would make it easier for others to help you.


Greetings,
Stefan Eike
steps.zip

Toshihiko Makita

unread,
Nov 8, 2016, 11:02:57 PM11/8/16
to DITA-OT Users
Dear Stefan,

Thank you for your good example. It works fine!

However the reason why I made keydef/@keys="CONNECTING_PRINTERS_STEP03" is to use it from multiple task instances. So I modified relevant stepsection as follows:

<stepsection id="stepsection_01">To configure the settings of the color measurement instrument, go to step <xref keyref="REFERENCE-TOPIC/step04"/>. Otherwise, go to step <xref keyref="REFERENCE-TOPIC/step05"/>.</stepsection>

And defined the REFERENCE-TOPIC key in the main bookmap as follows:

    <chapter navtitle="Prepareing to use the software" href="topics/cPreparingToUseVersaWorksDual.dita">
        <topicgroup keyscope="SINGLE-PRINTER">
            <keydef keys="REFERENCE-TOPIC" href="topics/tWhenConnectingASinglePrinter.dita"/>
            <topicref navtitle="Connecting a single printer" keyref="REFERENCE-TOPIC"/>
        </topicgroup>
        <topicgroup keyscope="MULTIPLE-PRINTER">
            <keydef keys="REFERENCE-TOPIC" href="topics/tWhenConnectingMultiplePrinters.dita"/>
            <topicref navtitle="Connecting multiple printer"  keyref="REFERENCE-TOPIC"/>
        </topicgroup>
    </chapter>

Both tWhenConnectingASinglePrinter.dita and tWhenConnectingMultiplePrinters.dita contain the same key reference.

    <stepsection conkeyref="CONNECTING_PRINTERS_STEP03/stepsection_01"/>

But DITA-OT 2.3.3 reports duplicate key definition error:

Scenario: DITA Map XHTML
Description: [DOTJ045I] The key "REFERENCE-TOPIC" is defined more than once in the same map file. The reference href="topics/tWhenConnectingMultiplePrinters.dita" is ignored.

According to the DITA 1.3 specification, I think same key definition in the different key scope is permitted.

2.3.4.10.7 Example: References to scoped keys



Is [DOTJ045I] error the bug of DITA-OT? Or are there another solutions?

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 --------------------------------------------------*/ 


2016年11月9日水曜日 4時23分33秒 UTC+9 Stefan Eike:

Stefan Eike

unread,
Nov 9, 2016, 3:48:39 AM11/9/16
to DITA-OT Users
Hi,

the DITA-OT picks the first key. If you define a key twice (or even more often), the DITA-OT throws the error you have mentioned. Congratulations, you're now entering the DITA 1.3 world of scoped keys! :)

Before you proceed, please read the following whitepaper to be prepared: https://www.oasis-open.org/committees/download.php/56472/Understanding%20Scoped%20Keys%20In%20DITA%201.3.pdf 

It explains, how you can define a scope for a key, so that it does not conflict with other keys that have the same name.


Greetings,
Stefan

Toshihiko Makita

unread,
Nov 9, 2016, 7:57:29 AM11/9/16
to DITA-OT Users
Hi,

> Congratulations, you're now entering the DITA 1.3 world of scoped keys! :)
> Before you proceed, please read the following whitepaper to be prepared: https://www.oasis-open.org/committees/download.php/56472/Understanding%20Scoped%20Keys%20In%20DITA%201.3.pdf 
>It explains, how you can define a scope for a key, so that it does not conflict with other keys that have the same name.

Yes, I have seen lots of keydef - keyref authoring examples that use scoped key since before DITA 1.3 is adopted as OASIS standard. But as far as I see there is no example that use keydef - conkeyref example that use scoped key functionality except DITA 1.3 specification mentioned above.

I realized that there is differences between DITA 1.3 specification and DITA-OT implementation. Applying multiple key scopes to the conkeyref'ed library (collection) topics may be far difficult than simple keydef – keyref mechanism.

Should I consider that [DOTJ045I] error is the DITA-OT limitation?

Stefan Eike

unread,
Nov 10, 2016, 3:28:58 AM11/10/16
to DITA-OT Users
Hi,

if you are sure, that your data should be valid in terms of the spec, please consider opening an issue on github.com/dita-ot/dita-ot and uploading a set of sample files. I've also noticed that duplicate key definitions with <keydef keys="mykey" href="myfile.dita"/> in key scopes don't work as I expect it to do. But I'm not sure if that violates the spec, is an unimplemented feature or a bug.

Greetings,
Stefan

Toshihiko Makita

unread,
Nov 16, 2016, 10:22:03 AM11/16/16
to DITA-OT Users
Thank you for your suggestion. 

I am not confident that this DITA-OT behavior is limitation or not. 
Before submitting issue, I will ask it in Yahoo! dita-users.

Regards,

2016年11月10日木曜日 17時28分58秒 UTC+9 Stefan Eike:
Reply all
Reply to author
Forward
0 new messages