Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Elegant way to create an empty line

From: "G. Ken Holman" <gkholman@----------------.--->
To: xsl-list@-----.------------.---
Date: 7/5/2009 12:08:00 PM
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@C...
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent