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]
Other format: [Raw text]

RE: TOC indents in XHTML?


> 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>&#xA0;&#xA0;</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


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