DocBook to Epub cover tweaks
Oxygen general issues.
-
- Posts: 37
- Joined: Fri May 20, 2011 6:07 pm
DocBook to Epub cover tweaks
I'm loving the DocBook to Epub transform, and I have figured out how to get most of my customizations in there.
2 minor issues are plaguing me:
1) Is there a way to change or customize the filename generated for the cover image (JPEG for me) in the "images" folder? It appears that the filename is currently based on the directory location of the image being copied in, so I have an enormously long filename that shows my directory in my epub. I would be fine with a standard, generic filename, like "coverImage" or something. Where can I customize this output?
2) In the "content.opf" there is an <item id="cover-image"...> that I have to delete to get valid ePub. The HREF for this item is picked up from the fileref for the image in my XML (so it is no longer a valid href) and the media-type is empty. Both of these issues invalidate the ePub. I also can't figure out why I need this in my opf, since the cover.html is there as well as a listing for the cover image itself in the images folder. Is this <item> necessary in my opf? How can I stop the transformation from producing it?
Thanks!
2 minor issues are plaguing me:
1) Is there a way to change or customize the filename generated for the cover image (JPEG for me) in the "images" folder? It appears that the filename is currently based on the directory location of the image being copied in, so I have an enormously long filename that shows my directory in my epub. I would be fine with a standard, generic filename, like "coverImage" or something. Where can I customize this output?
2) In the "content.opf" there is an <item id="cover-image"...> that I have to delete to get valid ePub. The HREF for this item is picked up from the fileref for the image in my XML (so it is no longer a valid href) and the media-type is empty. Both of these issues invalidate the ePub. I also can't figure out why I need this in my opf, since the cover.html is there as well as a listing for the cover image itself in the images folder. Is this <item> necessary in my opf? How can I stop the transformation from producing it?
Thanks!
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: DocBook to Epub cover tweaks
Post by sorin_ristache »
Hello,
Regards,
Sorin
Oxygen modifies the image file names from the item elements of content.opf with an image type media-type. The item element with the path of the cover image file is not modified because it does not have a media-type attribute. We will have to correct also in a future version of Oxygen the path of the image file in this item element. If you want to try it yourself you could modify the body of the xsl:if element from line 1038 of the stylesheet [OXYGEN-INSTALL-DIR]/frameworks/docbook/xsl/epub/docbook.xsl and generate also a media-type attribute in that item element. It starts with:jbzech wrote:1) Is there a way to change or customize the filename generated for the cover image (JPEG for me) in the "images" folder? It appears that the filename is currently based on the directory location of the image being copied in, so I have an enormously long filename that shows my directory in my epub. I would be fine with a standard, generic filename, like "coverImage" or something. Where can I customize this output?
Code: Select all
<xsl:if test="generate-id(.) = generate-id(key('image-filerefs', $fr)[1])">
As an alternative for the above suggestion you could try to remove the <item id="cover-image"...> element from content.opf by adding the following template to the stylesheet [OXYGEN-INSTALL-DIR]/frameworks/docbook/xsl/epub/removeImagesContentOpf.xsl:jbzech wrote:2) In the "content.opf" there is an <item id="cover-image"...> that I have to delete to get valid ePub. The HREF for this item is picked up from the fileref for the image in my XML (so it is no longer a valid href) and the media-type is empty. Both of these issues invalidate the ePub. I also can't figure out why I need this in my opf, since the cover.html is there as well as a listing for the cover image itself in the images folder. Is this <item> necessary in my opf? How can I stop the transformation from producing it?
Code: Select all
<xsl:template match="opf:item[@id = 'cover-image']"/>
Regards,
Sorin
-
- Posts: 37
- Joined: Fri May 20, 2011 6:07 pm
Re: DocBook to Epub cover tweaks
I was able to get the template in that removes "cover-image" successfully. Changing the xsl:if that handles filenaming might be beyond my current XSLT skills. I'll keep poking at it.
Thank you for the help.
Thank you for the help.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: DocBook to Epub cover tweaks
Post by sorin_ristache »
To find where the mediaobject.filename template is called from you can run the transformation in the Oxygen XSLT debugger, place a breakpoint inside the mediaobject.filename template, run the transformation to the breakpoint and at that moment look in the Stack view to see the caller template.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: DocBook to Epub cover tweaks
Hello,
I just wanted to let you know that we have corrected the path of the cover image file in the latest build of Oxygen 13.0, 2011091610:
The fix was made in "Oxygen/frameworks/docbook/xsl/epub/addImagesContentOpf.xsl"
http://www.oxygenxml.com/build_history.html#2011091610
You can download it from our web site:
http://www.oxygenxml.com/download.html
Note that if you upgrade your current installation of Oxygen, you will lose any modifications/customizations you have made to the files from the Oxygen directory.
Regards,
Adrian
I just wanted to let you know that we have corrected the path of the cover image file in the latest build of Oxygen 13.0, 2011091610:
The fix was made in "Oxygen/frameworks/docbook/xsl/epub/addImagesContentOpf.xsl"
The complete list of bug-fixes for this build can be found here:DocBook to EPUB: Fixed some problems from the EPUB published by the Docbook to EPUB transformation.
http://www.oxygenxml.com/build_history.html#2011091610
You can download it from our web site:
http://www.oxygenxml.com/download.html
Note that if you upgrade your current installation of Oxygen, you will lose any modifications/customizations you have made to the files from the Oxygen directory.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service