HTML5 CSS path wrong in output

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 2
Joined: Mon Apr 13, 2020 7:46 pm

HTML5 CSS path wrong in output

Post by ericn » Sat May 09, 2020 1:05 am

Hi, I have a project that renders fin when I transform the main ditamap, but the CSS links in the HTML do not point to the correct file path when I try to transform one of the child maps.

My main ditamap is at the root of my project, and the child ditamaps are in their respective ChapterNN/<child-map> folders. I have the following paramters set:

args.css = <name of CSS file>
args.cssroot = <absolute path to CSS folder, using ${pd} variable>
args.copycss = yes
generate.copy.outer = 3 (this is required to get the index.html files to point to the correct locations)

The CSS file gets copied to the ${pd}/out/html5 folder. But the links in my HTML files point to the following location:
<link rel="stylesheet" type="text/css" href="commonltr.css"><link rel="stylesheet" type="text/css" href="patc.css">

How can I get the HTML files to point to the correct CSS files?


Posts: 7579
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTML5 CSS path wrong in output

Post by Radu » Tue May 12, 2020 8:24 am

Hi Eric,

This looks like a bug in the way the DITA Open Toolkit publishing engine computes the path to the custom CSS when the generate.copy.outer is set to "3". If you are publishing from inside Oxygen maybe you can try to set the "fix.external.refs" parameter insted of generate.copy.outer: ... -refs.html

Otherwise I'm not sure what do advice you, if you can come up with a small sample project exhibiting the problem and send us an email ( I could try to check if the latest DITA OT version (version 3.5) still has this problem and if it does I can open an issue on the DITA OT issues list. As a workaround maybe you can run some kind of regular expression find/replace on the output folder to update the reference to the custom CSS. Or you could try to keep the submaps in the same folder as the main DITA Map, so that all topic references point to resources which are inside the DITA Map folder.

Radu Coravu
<oXygen/> XML Editor

Post Reply