Location of HTML Output Files When Transforming to epub

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jgreen
Posts: 10
Joined: Sun Oct 18, 2009 7:29 am
Location: Waterloo, Ontario, Canada

Location of HTML Output Files When Transforming to epub

Post by jgreen »

I am using the docbook-xsl-ns-1.75.2 xsl provided with Oxygen XML Editor 11 to transform DocBook 5 files to epub format. Until a few days ago (around the time I upgraded from 10.3 to 11?), the transformation created the OEBPS and META-INF folders in the same folder where the xml files were, but now it creates them in C:\Program Files\Oxygen XML Editor 11. I don't know what I've done to make this change, and I can't figure out how to change it back. The epub file is created in the folder where the xml files are (but the epub file is empty, which is a separate issue). When I transform to PDF or HTML, the output files are created in the folder where the xml files are. Version 10.3 is doing the same thing. Please help!

Thanks
John
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Location of HTML Output Files When Transforming to epub

Post by Radu »

Dear John,

As far as I can see you can edit the transformation scenario, click the Parameters button and edit the epub.metainf.dir parameter to have the value ${cfd}/META-INF/ and the epub.oebps.dir parameter to have the value ${cfd}/OEBS/.
This should help you get the desired behavior.
Things seem to have been the same with Oxygen 10.3.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jgreen
Posts: 10
Joined: Sun Oct 18, 2009 7:29 am
Location: Waterloo, Ontario, Canada

Re: Location of HTML Output Files When Transforming to epub

Post by jgreen »

Thanks, Radu. That did the trick (for the record, OEBS should be OEBPS).

Thanks
John
jgreen
Posts: 10
Joined: Sun Oct 18, 2009 7:29 am
Location: Waterloo, Ontario, Canada

Re: Location of HTML Output Files When Transforming to epub

Post by jgreen »

Hello Again,

The fix Radu suggested (adding "${cfd}/" to the epub.metainf.dir and epub.oebps.dir variables) did cause the OEBPS and META-INF folders to be created in the right place (the folder where the source xml files are), but it created a new problem. Parameter epub.opf.filename refers to epub.oebps.dir, and so now ends up containing the absolute path to the OEBPS folder (e.g., C:\Documents and Settings\John Green\My Documents\etc). This value is then used in container.xml in the .epub output file to specify the path to the opf file, making the epub invalid. This path needs to be just "OEBPS/content.opf". I can set epub.opf.filename to "OEBPS/content.opf", but this causes this OEBPS folder and its file to be created in the Oxygen folder.

Why do things keep going to the Oxygen folder when ${frameworks} is not specified in any of these parameters? I can't tell for sure whether it is Oxygen or the DocBook epub XSL transformation that is doing this, but I don't know why the DocBook XSL would cause this behaviour. I am not an expert in using Oxygen or XSLT or DocBook, but I don't understand what's going on.

Thanks for your help
John
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Location of HTML Output Files When Transforming to epub

Post by Radu »

Dear John

If the values set in the parameters are relative the stylesheets solve them relative to the started process (Oxygen) directory.
Indeed you should set one more parameter in order to have the transformation output in the XML source directory.
So I think the following parameters need to be set:
epub.metainf.dir set to ${cfd}/META-INF/
epub.oebps.dir set to ${cfd}/OEBPS/
epub.opf.filename set to OEBPS/content.opf

I'm sorry I cannot give you a link to some Docbook to EPUB documentation but it's a new transformation and I could not find a place where these parameters are explained properly.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jgreen
Posts: 10
Joined: Sun Oct 18, 2009 7:29 am
Location: Waterloo, Ontario, Canada

Re: Location of HTML Output Files When Transforming to epub

Post by jgreen »

That is what I have been doing. It creates all files correctly and in the correct location, except that OEBPS/content.opf is created in the Oxygen folder.

I have found another solution: I set all parameters back to their default values, added the Oxygen folder to Windows's PATH environment variable, and changed the Oxygen XML Editor desktop shortcut properties so that it starts in the folder where my XML files are. I have not found a down side to this fix, except that I must create a separate desktop shortcut for each project, since I keep each project's files in a separate folder.

Thanks for your help.

John
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Location of HTML Output Files When Transforming to epub

Post by Radu »

Hi John,

Looking in the OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/epub/docbook.xsl stylesheet, the epub.opf.filename parameter is used both as an absolute location to write to disk and as a value of the fullpath attribute.
So when the parameter has absolute value the location where it is saved is correct but the value of the attribute is not portable. And when the parameter has relative value the file gets saved relative to the application start directory but the attribute value is portable.

You can easily modify the stylesheet and for example at the location where the

Code: Select all

 <xsl:attribute name="full-path">
attribute is defined either use the value of a new parameter or comment the <xsl:value-of line and set hardcoded OEBPS/content.opf.
Something like:

Code: Select all


 <xsl:attribute name="full-path">
OEBPS/content.opf
<!-- <xsl:value-of select="$epub.opf.filename" />-->
</xsl:attribute>
In this way you can let the epub.opf.filename have the default set value and modify only the other two to point to the right directory.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply