Can only resolve conkeyrefs from first part of a composite resource files

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Erlend L
Posts: 15
Joined: Mon Mar 14, 2011 3:15 am

Can only resolve conkeyrefs from first part of a composite resource files

Post by Erlend L »

Product/version: oXygen XML Author Eclipse 28.1.0
Expected behavior: conkeyref should resolve an ID in any topic within the keyed composite DITA document.
Actual behavior: IDs in the first topic resolve, but IDs in subsequent topics do not.
Reproduction: see below
Comparison: DITA-OT resolves both references successfully.

I have composite resource files with common texts to be used in for example concept or task topics. Oxygen XML Author cannot resolve all of these. I have found that I get errors (in Author mode and when saving the file with the conkeyref) when I use conkeyrefs that are not present in the first part of the composite resource file. DITA-OT is perfectly happy with this, but not Oxygen.

Below is a complete example demonstrating this, the first conkeyref (for note1) in file test.dita works fine in Oxygen, while the second (step1) is marked as an error. I had a screenshot, but could not upload it. Also note that I have the root map (file root.ditamap) opened in the DITA Maps Manager, and its Context: setting is set to "<Current map>". Changing the Context: to root.ditamap gives the same result.

/Erlend

The map, root.ditamap:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd" []>
<map id="root">
    <title>Sample root map</title>
    <topicref href="test.dita"/>
    <keydef href="resource.dita" keys="res1" type="topic"/>
</map>
The resource file, resource.dita:

Code: Select all

<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
    <concept id="c1">
        <title>Concept</title>
        <conbody>
            <note id="note1">Works</note>
        </conbody>
    </concept>

    <task id="t1">
        <title>Task</title>
        <taskbody>
            <steps>
                <step id="step1">
                    <cmd>Works?</cmd>
                </step>
            </steps>
        </taskbody>
    </task>
</dita>
The file using the snippets from the resource file, test.dita:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="task0">
    <title>Task test</title>
    <taskbody>
        <context>
            <note conkeyref="res1/note1"/>
        </context>
        <steps>
            <step conkeyref="res1/step1">
                <cmd/>
            </step>
        </steps>
    </taskbody>
</task>[code]
Radu
Posts: 9690
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can only resolve conkeyrefs from first part of a composite resource files

Post by Radu »

Hi Erlend,

DITA Composites are deprecated and will be removed in the DITA 2.0 standard.
According to my interpretation of the DITA 1.3 specification, a key must be defined and can be used to point to content inside a single target DITA XML topic.
So in your example map, one would need to define the key specific for a certain topic inside the composite:

Code: Select all

<keydef href="resource.dita#c1" keys="c1_res1"/>
<keydef href="resource.dita#t1" keys="t1_res1"/>
and use these distinct keys.
Indeed the publishing works with your sample (while Oxygen's visual editor shows the error). But that's because the publishing is too laxed in this regard and does not precisely obey the specs.
I added some time ago an issue about this: https://github.com/dita-ot/dita-ot/issues/2816
The publishing engine will not fix this because it would become incompatible with older projects but when I implemented the conkeyref resolution in Oxygen I wanted to do things according to the specs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Erlend L
Posts: 15
Joined: Mon Mar 14, 2011 3:15 am

Re: Can only resolve conkeyrefs from first part of a composite resource files

Post by Erlend L »

Hello Radu, thanks for the response. This explains it; I will split any composite resource file into separate files (one for concept, one for task etc). That should get rid of the visual error in Oxygen and prepare for DITA 2.0 - no point in using something that will be deprecated.

Cheers,
Erlend
Radu
Posts: 9690
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can only resolve conkeyrefs from first part of a composite resource files

Post by Radu »

Hi Erlend,
With pleasure, sounds like a good plan!
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply