This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: converting to an <ol>
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Roman Huditsch" <roman dot huditsch at hico dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 14 Jun 2002 11:20:32 +0100
- Subject: Re: [xsl] converting to an <ol>
- Organization: Jeni Tennison Consulting Ltd
- References: <0C79A363CB0321418927D0CB1AD0403C1885A5@hicoetsrv000006.hico.local>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Roman,
> I would like to get the following HTML output via an XSL Stylesheet:
>
> 1. Africa
> 2. Europe
> 2.1 Italy
> 2.2 England
> 2.2.1 London
> 2.2.2 Oxford
HTML can't automatically give you multi-level numbering, so you have
to use XSLT to create the numbers. Fortunately, xsl:number does just
what you want if you set its level attribute to 'multiple'. Try the
following, or something like it:
<xsl:template match="item">
<div style="margin-left: 2em;">
<xsl:number level="multiple" format="1.1." />
<xsl:text> </xsl:text>
<xsl:apply-templates />
</div>
</xsl:template>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list