This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: TOC indents in XHTML?
- From: Jarno dot Elovirta at nokia dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 27 Nov 2001 16:44:14 +0200
- Subject: RE: [xsl] TOC indents in XHTML?
- Reply-to: xsl-list at lists dot mulberrytech dot com
> It works, but it's not smart and far from beautiful. There is
> a better way
> to do it, isn't it? :-)
<xsl:template name="toc-indent">
<xsl:call-template name="indent">
<xsl:with-param name="level" select="count(ancestor::part)" />
</xsl:call-template>
</xsl:template>
<xsl:template name="indent">
<xsl:param name="level" />
<xsl:if test="$level">
<xsl:text>  </xsl:text>
<xsl:call-template name="indent">
<xsl:with-param name="level" select="$level - 1" />
</xsl:call-template>
</xsl:if>
</xsl:template>
Jarno
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list