DITA-OT projects and spaces in filenames

Post here questions and problems related to editing and publishing DITA content.
uwe
Posts: 2
Joined: Tue Feb 20, 2024 1:42 pm
Contact:

DITA-OT projects and spaces in filenames

Post by uwe »

Hello!

I learned of the DITA-OT project feature last week on the DITA-OT day and hurried to implement it - we have been using a batch file to run the DITA transformation for each PDF separately, so using the DITA-OT project should be a lot more robust.

However, I immediately ran into a problem - our DITA map names often contain spaces, for example "Access Control.ditamap". This has not been a problem before - whether running a PDF transformation on that map via Oxygen or via the command line, the output file name always matched the input: "Access Control.pdf". It still works, when transforming the map directly.

The problem appears when the same map is specified in the DITA-OT project file:

Code: Select all

  <deliverable>
    <context name="Access Control">
      <input href="/source/rt_dev/dita/Access%20Control.ditamap"/>
      <profile>
        <ditaval href="PDF.ditaval"/>
      </profile>
    </context>
    <output href="./Standard%20dev/"/>
    <publication idref="pdf-dev"/>
  </deliverable>
The spaces in file names (and paths) have to be encoded as %20, but this means that the output will also be named Access%20Control.pdf. Again, this is only a problem when transforming the DITA-OT project.

Is there something else I could do besides changing all DITA map names so they wouldn't contain spaces? We are using Oxygen 25.1 and DITA-OT 3.7.4 on Windows, if it's relevant.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA-OT projects and spaces in filenames

Post by Radu »

Hello Uwe,

I'm glad you found a use for the DITA OT project file feature.
I consider the problem to be a bug, I added an issue for it here:
https://github.com/dita-ot/dita-ot/issues/4412
In the meantime you can take control over the PDF file name by using a certain parameter named "args.output.base", I tested with something like:

Code: Select all

<project xmlns="https://www.dita-ot.org/project">
  
<deliverable>
    
<context name="Access Control">
    
  <input href="D:/.../samples/dita/flowers/flo%20w%20ers.ditamap"/>
   
   </context>
    <output href="./Standard%20dev/"/>
    
   <publication name="pdf" transtype="pdf2">
      
   <param name="args.output.base" value="flo w ers"/>
   
    </publication>
 
     </deliverable>
</project>


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
uwe
Posts: 2
Joined: Tue Feb 20, 2024 1:42 pm
Contact:

Re: DITA-OT projects and spaces in filenames

Post by uwe »

Thank you!

This worked well. While I don't like repeating the other parameters for each deliverable, it works until the toolkit issue is fixed. 100+ PDFs compiled.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA-OT projects and spaces in filenames

Post by Radu »

Hi,
100+ PDFs compiled.
Yeah, DITA OT project files are quite useful to bring all your publishing needs together :D
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply