Hi all,
I'm trying to correctly format <br>-type line breaks in FOP. The default
template is to match <br> to an empty fo:block:
<xsl:template match="br">
<fo:block/>
</xsl:template>
This correctly breaks a line. However, it does nothing for this case:
<p>testing <!-- should break line --><br/>
<br/><!-- should create blank line-->
a blank line.
</p>
Where the second <br/> should create a blank line in the rendered output;
for that case, a template like:
<xsl:template match="br">
<fo:block> </fo:block>
</xsl:template>
works properly; but it inserts a blank line (instead of just a carriage
return).
What I've been trying to do (with no success) is something like the
following:
<xsl:choose>
<xsl:when
test="preceding-sibling::node()[1][text()='
']/preceding-sibling::node()
[1][name()='br']">
<fo:block> </fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block/>
</xsl:otherwise>
</xsl:choose>
Any help would be appreciated.
TIA,
John
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list