xsl-list
[Top] [All Lists]

Re: TOC despair

2003-12-03 17:23:56


<xsl:template match="section" mode="toc">
  ...
  <xsl:if test="count(following::section) = 0">
    <xsl:attribute name="margin-bottom">1em</xsl:attribute>
  </xsl:if>
  ...
</xsl:template>



looks OK it could be simlified to

<xsl:template match="section" mode="toc">
  ...
  <xsl:if test="following::section">
    <xsl:attribute name="margin-bottom">1em</xsl:attribute>
  </xsl:if>
  ...
</xsl:template>

but it depends a bit what your ... is, xsl:attribute can only be used
immediately after an element is opened, you cannot add an attribute
after adding any text or element children.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

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



<Prev in Thread] Current Thread [Next in Thread>