This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Numbering
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "alexandre bord" <alexandre dot bord at steria dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 10 Jul 2002 12:17:55 +0100
- Subject: Re: [xsl] Numbering
- Organization: Jeni Tennison Consulting Ltd
- References: <3D2C112E.7080405@steria.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Alexandre,
> Suppose i have an XML file like this :
> <section level="1" title="foo">
> <section level="2" title="bar">
> <section level="3" title="foobar">
> </section>
> </section>
> </section>
>
> How can i number each section title ? :
> 1. Foo
> ...
> 1.1 Bar
> ...
> 1.1.1 Foobar
> ...
> 2.
Use xsl:number with level="multiple":
<xsl:template match="section">
<xsl:number level="multiple" />
<xsl:text> </xsl:text>
<xsl:value-of select="@title" />
</xsl:template>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list