Re: Problem in search of solution

Subject: Re: Problem in search of solution
From: "Nikolai Grigoriev" <grig@xxxxxxx>
Date: Sat, 17 Jun 2000 00:33:08 +0400
Carlos,

> I'm trying to produce something such that only the last line will have the
> space-after.optimum attribute. Any ideas how can I do this?

You can either add an attribute conditionally:

 <xsl:for-each select="line">
   <fo:block font-weight="bold" font-size="12pt">

     <xsl:if test="not(following-sibling::line)">
       <xsl:attribute name="space-after.optimum">0.25in</xsl:attribute>
     </xsl:if>

     <xsl:value-of select="." />
  </fo:block>
</xsl:for-each>

or change your XSL FO structure - wrap the whole thing into an extra block that
will bear the required space-after margin, and generate blocks with no margins
for every single line inside it.

<xsl:template match="section_head">
  <fo:block font-weight="bold" font-size="12pt"
              space-after.optimum="0.25in">
    <xsl:aply-templates />
  </fo:block>
</xsl:template>

<xsl:template match="section_head/line">
  <fo:block><xsl:aply-templates /></fo:block>
</xsl:template>

This should work the same. IMO, this is a clearer solution.

Regards,
Nikolai Grigoriev
RenderX



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread