I need to hardcode img width for epub3 or html output. I need this to get around a kindlegen compilation bug.
However, when I did this in docbook, I get strange output!
<div class="mediaobject"><img src="" width="650" alt="Silver Link"/>
What I wanted to see (but did not) was:
<div class="mediaobject"><img src="" width="650px" alt="Silver Link"/>
Apparently the Docbook XSL strips "px" from the width value even though I say contentwidth="650px". That is bad.
Here is what the xml source looks like:
<mediaobject role="image-replace-title" >
<phrase> Silver Link</phrase>
<caption> <para>The Silver Link</para></caption>
Here is what the xsl customization layer looks like:
<?xml version="1.0" encoding="UTF-8"?>
exclude-result-prefixes="d date saxon" version="1.0">
<xsl:import href=""> <xsl:param name="html.stylesheet">general.css </xsl:param>
<xsl:param name="chapter.autolabel" select="0"/>
I literally stripped out everything else except for the elements I listed above.
Do you have anything which I can do to achieve the same result?
I noticed that if you use WIDTH attribute instead of CONTENTWIDTH, everything appears in a HTML table (bad!)
I also noticed that when I try to hardcode the attribute value using a trick Bob suggested a few years ago (https://lists.oasis-open.org/archives/docbook-apps/201108/msg00091.html
), it doesn't seem to put anything inside the output IMG tag. This xslt matching template in class.attribute mode doesn't seem to work within the IMAGEDATA element.
Thanks for your help.
PS, For the record, failure of kindle KF8 to support the max-width css combined with the failure of Amazon to document how kindlegen converts images in epub files is why I have to hardcode image width here (and why I have a frown on my face!)