Re: Keyrefs within conrefs #DITA-OT


ekimber@contrext.com
 

Not sure what you mean by "process the keys before the conrefs"?

Keys can only be resolved *after* conref resolution because the keys need to be resolved in the context of the referencing topic (and more specifically, the in the specific use context for each use of the referencing topic). [And it's actually more complicated than that, because you need to resolve direct conrefs, then construct the key spaces, then resolve key-based conrefs, then resolve non-conref keyrefs, but conceptually you have to resolve conrefs before you can resolve keyrefs.]

For example, imagine you have a reference to the key "prod-name" in a re-usable element that is then used by conref from a topic that is itself used in two different key scopes:

warehouse/warehouse.dita:

<topic id="warehouse">
<title>A Warehouse</title>
<body>
<p id="p1">The <keyword keyref="prod-name"/> product ....</p>
</body>
</topic>

And then in content topic "topics/real-topic.dita" you have:

<topic id=:"real-topic">
<title>A Real Topic</title>
<body>
<p conref="../warehouse/warehouse.dita#p1"/>
</body>
</topic>

And then in your map you have:

<map>
<title>Two-Product Publication</title>
<topicref keyscope="scope-1">
<keydef keys="prod-name">
<topicmeta><keywords><keyword>PROD A</keyword></keywords><topicmeta>
</keydef>
<topicref href="topics/real-topic.dita"/>
</topicref>
<topicref keyscope="scope-2">
<keydef keys="prod-name">
<topicmeta><keywords><keyword>PROD B</keyword></keywords><topicmeta>
</keydef>
<topicref href="topics/real-topic.dita"/>
</topicref>
</map>

The resolved value of the key "prod-name" is different in each key scope and needs to be reflected correctly in each use of real-topic.dita. The only way to do that is to resolve the conref and then resolve the resulting keyrefs (one for each use of real-topic.dita) in the context of the containing key scopes.

I don't know if OT does this (I haven't tested it) but this is the way it should behave.

Cheers,

E.

--
Eliot Kimber
http://contrext.com


´╗┐On 11/23/19, 12:22 PM, "Debra Bissantz" <dita-users@groups.io on behalf of dbissantz@vasont.com> wrote:

This is a question for the DITA-OT experts -

How does the DITA-OT process keyrefs within content referenced via conref? It seems that this worked in DITA-OT 2.x versions, but it is not working with DITA-OT 3.x versions. Is there a parameter that we should pass to process the keys before the conrefs?

Thanks, Deb

Join main@dita-users.groups.io to automatically receive all group messages.