Altova Mailing List Archives


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

From: Jan Hoeft <mail@--------.-->
To: <xsl-list@-----.------------.--->
Date: 7/5/2009 1:05:00 PM
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

--~------------------------------------------------------------------
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...>
--~--

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.