Hi,
having a quite simple template:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
I ask myself how to tell FO to keep empty lines if the block is empty.
Cheers
Jan
Hi,
having a quite simple template:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
I ask myself how to tell FO to keep empty lines if the block is empty.
Cheers
Jan
Just add a <fo:leader/>
element at the end of your <fo:block>
. Like this:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
<fo:leader />
</fo:block>
</xsl:template>
The leader will do nothing for lines with content, and will create an empty line for lines without content.
Tested with Apache FOP and XEP.
Alternatively,
<fo:block white-space-treatment="preserve"> </fo:block>
Or
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
 
</fo:block>
 
is the equivalent of
in HTML (actually
is a XML entity that is defined as A0 which is the Unicode character for Non Breaking Space).