Ralf Steppacher wrote:
I have a short question about spaces and precedences:
What I want is to suppress additional space if one headline directly follows another.


To achieve this I wrote the template with FOs below but it does not work (I played a bit with attributes and values and could not find any other working solution using precendences). Could anybody please tell me whether my FO is wrong or this is a limitation of FOP?

After having read the spec several times, i got the impression that space-*.precedence is for prioritizing space reservations coming from stuff from the same area.

Roughly:
  <fo:block space-before="10pt" precedence="1">
    <fo:block space-before="5pt" precedence="2">
      stuff
...
will put "stuff" 5pt after preceding content.

This means, precedence can't be used to collapse space-after
and space-before of consecutive blocks.

PS.: I know that I might just leave out the space-after of the top level headline. :-)

This is a solution, another one would be to take care of the conditionality at the XSLT level:

  <xsl:template match="products">
   <fo:block space-after="20pt" id="[EMAIL PROTECTED]">
      <xsl:number count="//[EMAIL PROTECTED]" format="1."/>
      <xsl:value-of select="prolog/title"/>
   </fo:block>
   <xsl:apply-templates select="product"/>
  </xsl:template>

  <xsl:template match="product">
    <fo:block>
      <xsl:if test="position()=1">
        <xsl:attribute name="space-before">30pt</xsl:attribute>
      </xsl:if>
      <xsl:number count="//[EMAIL PROTECTED]" level="multiple" format="1.1. "/>
      <xsl:value-of select="prolog/title"/>
    </fo:block>
    <xsl:apply-templates select="product_info"/>
    <!-- etc. ... -->
  </xsl:template>


HTH J.Pietschmann



Reply via email to