chunk="to-content" used along with keyref doesn't resolve properly in the temp files.

Post here questions and problems related to editing and publishing DITA content.
koushik9020
Posts: 13
Joined: Tue Dec 06, 2022 11:21 am

chunk="to-content" used along with keyref doesn't resolve properly in the temp files.

Post by koushik9020 »

Hello Team,
We are using the old version of dita-ot-1.8.5 because of the business needs, and we have plans of upgrading this to latest versions sometime in future after the on-going priorities. Given the fact that we're using the old version of dita-ot just wanted to know this below behaviour related to chunk="to-content" used along with keyref doesn't resolve properly in the temp/intermediate files.

For eg in the main ditamap of a given book/document we are chunking the below content using chunk="to-content" along with keyref:
<preface chunk="to-content" format="dita" keyref="GUID-570652A6-7C8D-45F8-BE53-76FFEE7CF8CC">
<topicmeta>
<navtitle>Preface</navtitle>
</topicmeta>
<topicref format="dita" keyref="GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9">
<topicmeta>
<navtitle>Audience</navtitle>
</topicmeta>
</topicref>
</preface>


The actual keydef for this keyref GUID is defined in a different ditamap file which we call it as: "guids.ditamap" like below way:
<keydef keys="GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9" href="Audience=GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9=5.xml" format="dita"/>

And this "guids.ditamap" file defined as a "mapref" inside the main ditamap file of a book/document which we are providing as a input for generating the XHTML output using the customised plugin that we developed our selves in dita-ot-1.8.5 like below way:
<mapref href="guids.ditamap"/>

Temp/intermediate ditamap file generated this below code snippet:

<topicref class="- map/topicref " format="dita"
href="Chunk894091371.xml#GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9"
ishlabelxpath="./topicmeta/navtitle[not(parent::*/parent::*/@href)] | @navtitle[not(parent::*/@href)] | @href[ancestor::*[@scope and @scope!=''][position()=1]/@scope='external']"
ishlinkxpath="@href[not(ancestor::*[@scope and @scope!=''][position()=1]/@scope='external')]"
ishtype="ISHSection" keyref="GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9" type="topic"
xtrc="topicref:3;60:82"
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/DPS-107510/xml/KKLH_Map_for_Library_Publication=GUID-1A2BE74C-D2B4-4799-B109-FFE2BBEE39FC=27.ditamap">


As we can see above href is generated as: "Chunk894091371.xml#GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9" which will cause the problems in the resolving the href in the xhtml output using our customised plugin for xhtml developed in dita-ot-1.8.5

<a href="Audience.html#GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9">Audience</a>
Gives a 404 error as this file doesn't exist in the output folder generated.
------------------------------------

Similarly if we use the chunk="to-content" along with href it resolves properly as expected in the temp files and also in the final xhtml output.

<preface chunk="to-content" format="dita" href="preface.xml">
<topicmeta>
<navtitle>Preface</navtitle>
</topicmeta>
<topicref format="dita" href="audience.xml">
<topicmeta>
<navtitle>Audience</navtitle>
</topicmeta>
</topicref>
<topicref format="dita" href="documentation-accessibility.xml">
<topicmeta/>
</topicref>
</preface>

Temp/intermediate file generates the below code snippet:
<topicref class="- map/topicref " format="dita"
href="preface.xml#GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9"
ishlabelxpath="./topicmeta/navtitle[not(parent::*/parent::*/@href)] | @navtitle[not(parent::*/@href)] | @href[ancestor::*[@scope and @scope!=''][position()=1]/@scope='external']"
ishlinkxpath="@href[not(ancestor::*[@scope and @scope!=''][position()=1]/@scope='external')]"
ishtype="ISHSection" type="topic" xtrc="topicref:1;11:1092"
xtrf="/Users/koushiktm/Desktop/projects/dita-ot-1.8.5/ditaroot/DPS-107510-SDL/xml/KKLP-map-library-publication.ditamap">

html output href is also resolved properly like below way:
<a href="preface.html#GUID-23DB210A-D5A6-4F88-99C4-1C1A50E84AA9">Audience</a>


How can we make sure we can generate the same code snippet inside the temp/intermediate files while using chunk="to-content" with keyref similar to that of href.

Kindly suggest if there's any workaround to be used in this old version of dita-ot-1.8.5.

Thanks & Regards,
Koushik
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: chunk="to-content" used along with keyref doesn't resolve properly in the temp files.

Post by chrispitude »

Hi Koushik,

This seems like more of a DITA-OT question than an Oxygen question. You could consider asking on the DITA-OT mailing list here:

https://groups.google.com/g/dita-ot-users

However, DITA-OT 1.8.5 is quite old and I think it will be difficult for others to spend time debugging this issue if you haven't also tried the latest version to see if it's a bug that has been fixed. I suggest creating a small standalone testcase to reproduce the issue in DITA-OT 1.8.5, then see if the issue persists in the latest version. This will give you a better idea on what is going on.

If the issue persists in the latest DITA-OT version too, then you can file an issue so that developers can work on the issue.
Post Reply