XSL-FO - Empty block elements

xsl-fo

Solution

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.

Problem

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.

Original source