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

Re: Elegant way to create an empty line

Subject: Re: Elegant way to create an empty line
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 05 Jul 2009 08:06:57 -0400
Re:  Elegant way to create an empty line
At 2009-07-05 13:58 +0200, Jan Hoeft wrote:
is there an elegant way to create empty lines using block elements?

My template is quite simple:

<xsl:template match="p">
  <fo:block>
     <xsl:apply-templates/>
  </fo:block>
</xsl:template>

How do I tell FO to create a new line for each <p/>?

Do you mean to leave a blank between the previous block and this block?


<fo:block space-before="1em">

Do you mean to leave a blank between this block and the next block?

<fo:block space-after="1em">

In both cases, when that space is at the very beginning or very end of a reference area (say a column), the space is discarded. This is very helpful when displaying continuous blocks across multiple columns/pages.

If, however, you are asking about creating an empty line regardless of the content of the element, that would be:

<fo:block><fo:leader/></fo:block>

This is more elegant than using a non-breaking space or other special graphic character. And more elegant than using regular spaces in combination with properties that prevent their collapse.

But I am unclear about your question in that you are asking about empty lines yet your template is quite obviously adding the content of your paragraph to the result tree.

I hope this helps.

. . . . . . . . . . . . . Ken


-- Possible July/August XSLT/XQuery/XSL-FO training in Oakland/CA/USA Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

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-2013 All Rights Reserved.