Page 1 of 1
.ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Wed Jan 11, 2023 4:39 pm
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
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).
Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Wed Jan 11, 2023 8:09 pm
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
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
Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Thu Jan 12, 2023 4:24 pm
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
Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Fri Jan 13, 2023 2:54 pm
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.
Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Thu Feb 02, 2023 10:21 am
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
Re: .ditamap file is replaced with its DITA-OT temporary file equivalent after transformation
Posted: Thu Feb 02, 2023 2:38 pm
by chrispitude
Radu - thank you for fixing this so quickly! And thank you for contributing this fix back to the DITA-OT.