keyscope attribute does not work as expected

Post here questions and problems related to editing and publishing DITA content.
MarcelM
Posts: 5
Joined: Mon Feb 04, 2019 5:59 pm

keyscope attribute does not work as expected

Post by MarcelM »

Hello,
I try to work with the "keyscope" attribute on two maprefs in the main "Map.ditamap".
Each referenced map defines the same key "topic".
This key is used in a topic with a keyref (see <dt>A</dt>) and it works as expected.
If I use the key within a <p> element (see <p id="Referrer"> in TemplatesA.dita) which itself is used by a conkeyref (see <dt>B</dt>) or conref (see <dt>C</dt>) the reference is resolved only once.

Have i missed something?

The result is this:
---------------
Referring 1
This topic should refer to "Topic 1"
A
Referring to: Topic 1
B
This Template text refers to the special text of: Topic 1
C
This Template text refers to the special text of: Topic 1
---------------
Referring 2
This topic should refer to "Topic 2"
A
Referring to: Topic 2
B
This Template text refers to the special text of: Topic 1 //<<< unexpected!!! should be: Topic 2
C
This Template text refers to the special text of: Topic 1 //<<< unexpected!!! should be: Topic 2
---------------

Here an excerpt of my files:
"Chapter1\Chapter1.ditamap"

Code: Select all

	<mapref href="../TemplatesFolder/Templates.ditamap" processing-role="resource-only" />
<topicref href="Referring1.dita"/>
<keydef keys="topic" href="Topic1.dita"/>
"Chapter1\Referring1.dita"

Code: Select all

	<p>This is individual text of Referring one.</p>
<p>This topic should refer to "Topic 1"</p>
<dt>A</dt>
<dd><p>Referring to: <xref keyref="topic"/></p></dd>
<dt>B</dt>
<dd><p conkeyref="TemplatesA/Referrer"></p></dd>
<dt>C</dt>
<dd><p conref="../TemplatesFolder/TemplatesA.dita#Inhalt/Referrer"></p></dd>
"Chapter1\Topic1.dita"

Code: Select all

	<title>Topic 1</title>
"Chapter2\Chapter2.ditamap"

Code: Select all

	<mapref href="../TemplatesFolder/Templates.ditamap" processing-role="resource-only" />
<topicref href="Referring2.dita"/>
<keydef keys="topic" href="Topic2.dita"/>
"Chapter2\Referring2.dita"

Code: Select all

	<p>This is individual text of Referring two.</p>
<p>This topic should refer to "Topic 2"</p>
<dt>A</dt>
<dd><p>Referring to: <xref keyref="topic"/></p></dd>
<dt>B</dt>
<dd><p conkeyref="TemplatesA/Referrer"></p></dd>
<dt>C</dt>
<dd><p conref="../TemplatesFolder/TemplatesA.dita#Inhalt/Referrer"></p></dd>
"Chapter2\Topic2.dita"

Code: Select all

	<title>Topic 2</title>
"TemplatesFolder\Templates.ditamap"

Code: Select all

	<keydef keys="TemplatesA" href="TemplatesA.dita"/>
"TemplatesFolder\TemplatesA.dita"

Code: Select all

	<p id="Referrer">This Template text refers to the special text of: <xref keyref="topic"/></p>
"Map.ditamap"

Code: Select all

	<mapref href="Chapter1/Chapter1.ditamap" keyscope="ONE" />
<mapref href="Chapter2/Chapter2.ditamap" keyscope="TWO" />
Complete download here:
https://inosoftgmbh-my.sharepoint.com/: ... Q?e=xdTQU2

Thanks
Marcel
Radu
Posts: 8010
Joined: Fri Jul 09, 2004 5:18 pm

Re: keyscope attribute does not work as expected

Post by Radu »

Hi Marcel,

I would not have expected the conref to work but I would have expected the conkeyref to work.
I tested your sample also with DITA OT 3.2.1 but it still does not work as expected.
There is an already opened issue which in my opinion is similar to yours, I added a comment and your samples there:

https://github.com/dita-ot/dita-ot/issues/2525

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 470
Joined: Thu May 02, 2019 2:32 pm

Re: keyscope attribute does not work as expected

Post by chrispitude »

I think this was fixed in DITA-OT 3.7:

https://github.com/dita-ot/dita-ot/issues/2525

I added my findings in the log.
Post Reply