[xsl] Dynamic numbering of lists in xslt

Subject: [xsl] Dynamic numbering of lists in xslt
From: xslt.new <xslt.new@xxxxxxxxx>
Date: Mon, 8 Jan 2007 13:04:47 -0600
Hi:

I am a newbie to xslt and XSLFO. I have to do a numbering which offers the
flexibility to reorder elements if an element in between is being removed.

I will try to demonstrate with an example input.

<chapter1>
  <section>first section<section>
</chapter1>
<chapter1>
 <section>second section</section>
</chapter1>
<chapter1>
 <section>third section</section>
</chapter1>
<chapter1>
 <section>fourth section</section>
</chapter1>

So, I want my output to look like

1. first section
2. second section
3. third section
4. fourth section

and so on. Suppose one chapter1 element is removed in between, lets say
second section, then the numbering should reset itself so that now the
output looks like:

1. first section
2. third section
3. fourth section

Is it possible to achieve this in xslt and XSLFO?

Please do let me know.

Thanks

Current Thread