[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: <br>-type template match for FOP

Subject: Re: <br>-type template match for FOP
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 12 Dec 2003 19:29:45 +0100
fop line break
John Dunning wrote:
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>

Actually it creates a blank line. The new line happens to have zero height though.

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>&#160;</fo:block>
</xsl:template>

works properly; but it inserts a blank line (instead of just a carriage
return).

Actually what's wrong with this? You can try a zero width space instead of a non-breaking space (&#x200B;). Technically speacking, and for the majority of layout orientend output formats, the block forces a line break, rather then inserting a line feed. The latter is a character, the former is a layout action.

In any case, both <br/> and using a block in FO to force a line break is
considered bad style, from the viewpoint of pure typography.

<rant>
  They should never have allowed mixing block FOs with text and inline FOs.
</rant>

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.