On 28.10.2011 16:38, Lars Vogel wrote:

> I'm generating epubs via Docbook and the epub XSLT stylesheets. If I convert
> them to mobipocket for the Kindle lists are incorrectly displayed.
> 
> <ul><li> Hello </li> </ul>
> 
> The dot is in one line and the text in another. Screenshot attached.
> 
> I tried kindlegen and Calibre.
> 
> Anyone know how to solve this?

The problem is that DocBook stylesheets wrap content of listitem in <p>
(because originaly it was <para> in DocBook). The easiest way how to fix
this is to postprocess generated XHTML files and remove <p>s inside
<li>. I'm using attached XSLT transformation (inspired by code provided
by Adam Witwer originaly).

                                Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: [email protected]      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet 
    xmlns="http://www.w3.org/1999/xhtml"; 
    xmlns:h="http://www.w3.org/1999/xhtml"; 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
    exclude-result-prefixes="h xsl" 
    version="1.0">
    <xsl:output 
                encoding="UTF-8"
                omit-xml-declaration="no"/>

  <xsl:template match="/">
    <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html></xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="h:li/h:p">
    <xsl:apply-templates/>
    <br/>
  </xsl:template>

</xsl:stylesheet>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to