I have a quite simple template:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
How do I tell FO to keep empty lines even if the block is empty.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With