This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem in search of solution


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]