Topics

Conrefs and key scopes #DITA-OT #conref

Ozana Dragomir
 

Hi all,

Sorry if this has been asked before.

We have some "reusable content" DITA files where in some places we use keys - for example for product name, etc.

When publishing topics referenced from inside a defined keyscope, the keys in the conref-ed text are not resolved. It seems to be a problem with DITA-OT, as in oXygen Author the keys are resolved  properly.
Is there any combination of command line parameters or anything else that can give me the expected output? I need the keyscopes for publishing to WebHelp - multiple instances of the same document for different variants.
I'm using DITA-OT 3.3.4.

Example:

Bookmap:
<chapter href="topics/topic_a.dita" format="dita" type="concept" keyscope="A">
        <ditavalref><ditavalmeta>
                <dvrResourceSuffix>-a</dvrResourceSuffix>
            </ditavalmeta></ditavalref>
       
        <keydef keys="var_variant_number">
            <topicmeta><keywords>
                    <keyword>AXxxx</keyword>
                </keywords></topicmeta>
        </keydef>
        <topicref href="topics/topic_b.dita" />
</chapter>

topic_b.dita contains:
<p>For <keyword keyref="var_variant_number"/>, see <ph conref="../conrefs/doc_titles.dita#doc_titles/id_ph_TRM_title"/> for details.</p>
Note: using conkeyref here doesn't change anything, the output is the same.

doc_title.dita contains:
<ph id="id_ph_TRM_title"><keyword keyref="var_variant_number"/> Technical Reference Manual</ph>


The output will be:
        For AXxxx, see Technical Reference Manual for details.

Desired output:
       For AXxxx, see AXxxxTechnical Reference Manual for details.

Many thanks

Best regards,
Ozana

Radu Coravu
 

Hi Ozana,

The situation might look similar with this one:

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

But I'm not sure, a complete sample small project would have helped.
Some advice:

- Use conkeyref, I would not expect this to work with conref.
- Have a topic reference to the "doc_titles.dita" in both key scope contexts.
- Use DITA OT 3.4

Regards,
Radu

Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

On 2/7/2020 5:03 PM, Ozana Dragomir wrote:
Hi all,
Sorry if this has been asked before.
We have some "reusable content" DITA files where in some places we use keys - for example for product name, etc.
When publishing topics referenced from inside a defined keyscope, the keys in the conref-ed text are not resolved. It seems to be a problem with DITA-OT, as in oXygen Author the keys are resolved  properly.
Is there any combination of command line parameters or anything else that can give me the expected output? I need the keyscopes for publishing to WebHelp - multiple instances of the same document for different variants.
I'm using DITA-OT 3.3.4.
Example:
*Bookmap:*
<chapter href="topics/topic_a.dita" format="dita" type="concept" keyscope="A">
        <ditavalref><ditavalmeta>
                <dvrResourceSuffix>-a</dvrResourceSuffix>
            </ditavalmeta></ditavalref>
        <keydef keys="var_variant_number">
            <topicmeta><keywords>
                    <keyword>AXxxx</keyword>
                </keywords></topicmeta>
        </keydef>
        <topicref href="topics/topic_b.dita" />
</chapter>
*topic_b.dita contains:*
<p>For <keyword keyref="var_variant_number"/>, see <ph conref="../conrefs/doc_titles.dita#doc_titles/id_ph_TRM_title"/> for details.</p>
*Note:* using conkeyref here doesn't change anything, the output is the same.
*doc_title.dita contains:*
<ph id="id_ph_TRM_title"><keyword keyref="var_variant_number"/> Technical Reference Manual</ph>
*The output will be:*
        For AXxxx, see Technical Reference Manual for details.
*Desired output:*
       For AXxxx, see AXxxxTechnical Reference Manual for details.
Many thanks
Best regards,
Ozana

Ozana Dragomir
 

Hi Radu,

Thanks a lot for the tips. I have previously tried with conkeyref and had the same result as with conref. The key defintion for doc_titles.dita was in the <frontmatter> and it seems like this was the deal breaker.

After moving <keydef keys="key_doc_titles" href="conrefs/doc_titles.dita"/> out of the frontmatter and in both keyscopes, I can confirm that the conkeyrefs are resolved using DITA-OT 3.x that comes with Oxygen 21.1, also with 3.3.4 and 3.4.

Now the only problem is that I get this error:
        Description: [DOTJ046E] Conkeyref="key_doc_titles/id_ph_CIG_title" can not be resolved because it does not contain a key or the key is not defined. The build will use the conref attribute for fallback, if one exists.

This means that there will be lots of such errors in the real project, and it will be a pain to sort out which errors are "real" and which can be ignored.
But it's a (big) step forward!

Thanks again,
Ozana


Radu Coravu
 

Hi Ozana,

How about if you keep that key definition for "key_doc_titles" in the front matter and also copy it inside both key scopes?

Regards,
Radu

Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

On 2/10/2020 1:56 PM, Ozana Dragomir wrote:
Hi Radu,
Thanks a lot for the tips. I have previously tried with conkeyref and had the same result as with conref. The key defintion for doc_titles.dita was in the <frontmatter> and it seems like this was the deal breaker.
After moving <keydef keys="key_doc_titles" href="conrefs/doc_titles.dita"/> out of the frontmatter and in both keyscopes, I can confirm that the conkeyrefs are resolved using DITA-OT 3.x that comes with Oxygen 21.1, also with 3.3.4 and 3.4.
Now the only problem is that I get this error:
        Description: [DOTJ046E] Conkeyref="key_doc_titles/id_ph_CIG_title" can not be resolved because it does not contain a key or the key is not defined. The build will use the conref attribute for fallback, if one exists.
This means that there will be lots of such errors in the real project, and it will be a pain to sort out which errors are "real" and which can be ignored.
But it's a (big) step forward!
Thanks again,
Ozana