DocBook to ePUB with SVG?

Oxygen general issues.
msarrel
Posts: 10
Joined: Tue Aug 24, 2010 6:49 pm

DocBook to ePUB with SVG?

Post by msarrel »

I'm trying to convert a DocBook file with SVG images to ePUB. The problem is that the images don't appear in the ePUB. Neither the DocBook nor SVG files have validation errors. Here is the <imageobject> fragment from DocBook.

Any ideas?

Code: Select all

<mediaobject>
<imageobject>
<imagedata fileref="test_files/_17_0_2_31d104c4_1315959697454_106692_95624.svg" format="SVG" scalefit="1" width="100%"/>
</imageobject>
</mediaobject>
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook to ePUB with SVG?

Post by Radu »

Hi,

There is a problem in the stylesheet used to copy referenced images to the output folder.
We'll correct it and the fix will probably be included in Oxygen 13.1 in a couple of months.
Until then you can open the stylesheet:

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/epub/images.xsl

and add in it the following xsl:template:

Code: Select all

  <xsl:template match="@data[parent::xhtml:object[@type='image/svg+xml']]">
<xsl:variable name="imagePath" select="XSLTExtensionIOUtil:copyFile($inputDir, ., $outputDir, $imagesDir)"/>
<xsl:attribute name="data"><xsl:value-of select="$imagePath"/></xsl:attribute>
</xsl:template>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply