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

Re: FO: padding within list problem (really FOP)

Subject: Re: FO: padding within list problem (really FOP)
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 10 Aug 2004 21:44:23 +0200
fop nbsp
Ralph Holz wrote:
I've got the following code snippet:
<fo:list-item>
  <fo:list-item-label>
     <fo:block  padding-bottom="1.7mm">
      <xsl:value-of ...
    </fo:block>
...
The padding properties were added in fo:block because FOP didn't use it when it was within any of the parent elements. (If anyone knows a better solution to this, please let me know.)
Padding (and most other block properties) isn't properly implemented
except for blocks.

They are meant to ascertain a certain distance between the list items. (is that the way to do it?)
Using padding for this is ... not the way padding was intended to
be used.
Try space-after. Use nested blocks if really necessary.

The problem I'm facing is that if anyone of the <xsl:value-of> evaluates to null (i.e. empty element in XML source tree), there is no padding anymore in that line and the next item data overwrites that line (it "moves up").
Well, apparently padding has more than a problem even for blocks.
One way to work around problems with empty blocks is to use a
white-on-white character or perhaps a NBSP (wont work in all contexts),
for example
  <xsl:variable name="my-content" value="... expression ..."/>
  <xsl:choose>
    <xsl:when test="$my-content">
      <!-- perhaps test="normalize-space($my-content)" -->
      <xsl:value-of select="$my-content"/>
    </xsl:when>
    <xsl:otherwise>
      <fo:wrapper color="$bg-color">i</fo:wrapper>
      <!-- or simply <xsl:text>&#160;</xsl:text>
    </xsl:otherwise>
  </xsl:choose>

J.Pietschmann

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.