.ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post here questions and problems related to editing and publishing DITA content.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

.ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by chrispitude »

While making a testcase, I was running the PDF - HTML5 & CSS transformation repeatedly.

The first few transformations ran normally. The fourth failed due to a corrupted .ditamap file. It turns out that somehow the .ditamap file in my DITA source directory was overwritten with the ${dita.temp.dir} version of it:

image.png
image.png (141.95 KiB) Viewed 842 times

Note the @xtrc and @xtrf attributes. In addition, the file content is truncated early, indicating some kind of abnormal termination.

I am not even sure how this could happen. The .dita files are not modified, so perhaps preprocessing broke itself in the early map processing stages before it got to the processing topic stages.

Interestingly, this is not the first time. A couple months ago, a user came to me with the same issue. We simply restored the file from Git and moved on.

I am not requesting any immediate action; I am just sharing the event. If it happens again, I will reply back here. I will also try to look at the log file next time (it's too late for this time, I reran a couple times before I figured out what was going on).
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by chrispitude »

I think this issue is specific to the implementation of args.root.map in the pdf-css-html5-single-topic transformation. Here's a testcase:

oxygen_corrupted_map.zip
(31.26 KiB) Downloaded 153 times

To reproduce the issue,
  • Open the .xpr file.
  • Open the .ditamap file.
  • Open the topic from the DITA Maps Manager.
  • Make sure the topic editing window is selected and active.
  • In the toolbar, run the DITA PDF - based on HTML5 & CSS transformation on the topic.
In the transformation log, the map is included in the file list, but in its original place instead of copied to the temporary directory, and so I think it gets overwritten in its original location by preprocessing (see highlights below):

Code: Select all

gen-list:
 [gen-list] Using Xerces grammar pool for DTD and schema caching.
 [gen-list] Processing file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
 [gen-list] Processing file:/C:/nobackup/oxygen_corrupted_map/topics/topic.dita
 [gen-list] Serializing job specification

debug-filter:
   [filter] Using Xerces grammar pool for DTD and schema caching.
   [filter] Processing file:/C:/nobackup/oxygen_corrupted_map/map.ditamap to file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
                                                              ^^^^^^^^^^^
   [filter] Processing file:/C:/nobackup/oxygen_corrupted_map/topics/topic.dita to file:/C:/nobackup/oxygen_corrupted_map/topics/temp/topic-pdf-css-html5/oxygen_dita_temp/topic.dita

mapref-check:

mapref:
   [mapref] Processing file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
                                                              ^^^^^^^^^^^

branch-filter:
[branch-filter] Processing file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
                                                                  ^^^^^^^^^^^
[branch-filter] Processing file:/C:/nobackup/oxygen_corrupted_map/topics/temp/topic-pdf-css-html5/oxygen_dita_temp/topic.dita

keyref:
   [keyref] Reading file:/C:/nobackup/oxygen_corrupted_map/topics/temp/topic-pdf-css-html5/oxygen_dita_temp/topic.dita
   [keyref] Reading file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
                                                           ^^^^^^^^^^^
   [keyref] Processing file:/C:/nobackup/oxygen_corrupted_map/map.ditamap
                                                              ^^^^^^^^^^^
   [keyref] Processing file:/C:/nobackup/oxygen_corrupted_map/topics/temp/topic-pdf-css-html5/oxygen_dita_temp/topic.dita
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by julien_lacour »

Hi Chris,

The problem seems only happening with Oxygen 25.0, I added an issue on our side for fixing this problem.
I also added an issue on DITA-OT side, the problem also occur with HTML5 outputs: https://github.com/dita-ot/dita-ot/issues/4104

Regards,
Julien
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by chrispitude »

Hi Julien,

Thanks for filing the DITA-OT issue! I thought I checked the regular DITA-OT to see if this was an underlying issue, but I must have done something wrong in checking that.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by Radu »

Hi,

To update this thread, our latest 25.0 minor bug fix release should have a fix for this problem:
https://www.oxygenxml.com/build_history.html#2023013006
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation

Post by chrispitude »

Radu - thank you for fixing this so quickly! And thank you for contributing this fix back to the DITA-OT.
Post Reply