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: Numbering


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


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