<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