[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: Jan Hoeft <mail@xxxxxxxxxxx>
Date: Sun, 05 Jul 2009 15:04:51 +0200
Re:  Elegant way to create an empty line
Hi Ken,
thanks for your ideas.

>><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/>?

To use space-before or space-after I would have to count the following
empty paragraphs in my document.


So if my document looks like:

<p>some text</p>
<p/>
<p/>
<p>more text</p>


The result should look like this:

+-----------+
|some text  |
|           |
|           |
|more text  |
+-----------+


My template generates:

<fo:block>some text</fo:block>
<fo:block/>
<fo:block/>
<fo:block>some text</fo:block>


Since emty blocks collapse, this gives me:

+-----------+
|some text  |
|more text  |
+-----------+


I am searching a solution that does not have to know the content of the
paragraphs or the number of empty paragraphs.
Using leaders or space-after I always have to decide whether the content is
empty or not.

Do you have an idea?
Jan

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.