Page 1 of 1

DITA Map EPUB args.copycss is not working

Posted: Fri Oct 18, 2019 5:51 am
by gevin
Hello <Oxygen/> team,

I am using Oxygen version 21.0 for my project. DITA-OT 3.x working great to transform my project DITA map .ditamap to HTML5 website using DITA Map HTML5, It work perfectly, which included a customize CSS file.

I am currently trying to transform the same project to ePub version, using build in DITA Map EPUB scenario type, but face some problem. This DITA Map EPUB scenario type fail to copy the custom CSS file to the ePub package even args.copycss, args.css setting are set correctly (same setting for DITA Map HTML5).

For example, if i have a custom CSS file proj_01.css in the directory c:\projects\proj_01\css and i wish to include this CSS file in the EPUB,

This is what I specify to these Ant parameter args.css with the value like:
  • args.copycss as "yes"
  • args.cssroot as "c:\projects\proj_01\css"
  • args.css as "proj_01.css"
  • args.csspath as "css"
Do you mind to help me on this issue?

Thank you very much.

Re: DITA Map EPUB args.copycss is not working

Posted: Fri Oct 18, 2019 12:15 pm
by Radu
Hi,

Try to remove the "args.cssroot" and "args.csspath" parameters and set the "args.css" parameter to "c:\projects\proj_01\css\proj_01.css".
If this still will not work I will try to take a look at it.

Regards,
Radu

Re: DITA Map EPUB args.copycss is not working

Posted: Fri Oct 18, 2019 12:29 pm
by gevin
Hi Radu,

Thank you for help.

i have tried the suggestion you just posted, but still not working. :(

any other idea?

Regards,
Gevin

Re: DITA Map EPUB args.copycss is not working

Posted: Mon Oct 21, 2019 4:13 am
by gevin
Hi Radu,

Thank you for your reply. I tried your suggestion to remove remove the "args.cssroot" and "args.csspath" parameters and set the "args.css" parameter to "c:\projects\proj_01\css\proj_01.css", but the result still the same DiTA-OT does not copy the customize CSS file into to the ePub package.

Best regards,
Gevin

Re: DITA Map EPUB args.copycss is not working

Posted: Mon Oct 21, 2019 12:06 pm
by Radu
Hi Gevin,

I reproduced the problem on my side and added an internal issue to fix it.
As a workaround if you open the ANT build file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\org.dita4publishers.epub\build_transtype-epub.xml

it has there a target which looks like this:

Code: Select all

 <target name="epub.xhtml.init" if="isOT2">
You can try to remove the if="isOT2" attribute from it and try to publish again.

Regards,
Radu

Re: DITA Map EPUB args.copycss is not working

Posted: Tue Oct 22, 2019 5:05 am
by gevin
Hi Radu,

Thank you for the temporary fix. I removed the if="isOT2" attribute from it and publish again, and this fixed the args.copycss issue.

Everything working perefectly now!
Radu wrote:
Mon Oct 21, 2019 12:06 pm
....
As a workaround if you open the ANT build file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\org.dita4publishers.epub\build_transtype-epub.xml

it has there a target which looks like this:

Code: Select all

 <target name="epub.xhtml.init" if="isOT2">
Good job, i am very appreciated for your help.

Best regards,
Gevin

Re: DITA Map EPUB args.copycss is not working

Posted: Wed Oct 23, 2019 4:50 am
by gevin
Hi Radu,

another question,

In the ePub 3 package have a file named "nav.xhtml" that is used for a Reading Systems to retrieve navigational information. DITA-OT ePub generated content.opf which listed "nav.xhtml" as 1st item in <spine> section, this result an extra/duplicated Content page appear before actual contents.

Is there any way to remove <itemref idref="nav"/> from <spine toc="ncx"> section using DITA-OT parameter?

Thank you.

Best regards,
Gevin

Re: DITA Map EPUB args.copycss is not working

Posted: Thu Oct 24, 2019 9:29 am
by Radu
Hi Gevin,

I do not see a parameter to control this. There is an XSLT template:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\org.dita4publishers.epub\xsl\map2epubOpfImpl.xsl

which has a template which outputs it:

Code: Select all

  <xsl:template match="*[df:class(., 'map/map')]" mode="spine">
    <xsl:param name="doDebug" as="xs:boolean" tunnel="yes" select="false()"/>
     <!-- Generate entries for each of the navigation files to be generated. -->
    <xsl:if test="$epubtrans:isEpub3">
      <itemref idref="{epubtrans:getNavId('toc')}"/>
    </xsl:if>
  </xsl:template>
so commenting that xsl:if should accomplish what you want. But I saw that the table of contents seems to disappear completely from the book so I'm not sure this is what you want.

Regards,
Radu

Re: DITA Map EPUB args.copycss is not working

Posted: Tue Oct 29, 2019 5:01 am
by gevin
Hi Radu,

Thank you for your "hack" to modify the XSLT to meet my need. For my case, the ePub reader like iBook, Adobe Digital Edition or Vital Source will genarate their own version of Table of contents based on nav.xhtml, but don't need use as page in the book.

That mean, nav.xhtml is needed in the ePub package, but do not need to be display as content page or list as part of the book spine.

Thank you very much for your help again.

Best regards,
Gevin

Re: DITA Map EPUB args.copycss is not working

Posted: Wed Feb 19, 2020 8:31 am
by Radu
Hi,

As an update we released Oxygen version 22 and it should have the fix for the first reported problem included.

Regards,
Radu