Re: Dynamic numbering of lists in xslt
Thank you for all your responses. I should have mentioned that I did use <xsl:number>, but the problem I am facing is with the filtering.
I have some logic on the style sheet to filter out section 2. What that does is it filters it out but the input XML remains the same.
So, in my xslt, I use:
<xsl:choose> <xsl:when test="section='second section'> <!-- Do not display thi section --> </xsl:when> </xsl:choose>
But overall, the input XML still remains as: <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, the <xsl:number> numbers the <chapter1> sequentially, and as a result,
my output has:
1. first section 3. third section 4. fourth section
This is part of a huge issue that I am facing and so pasting the whole XSLT here might be too cumbersome.
Can you give me any idea on how to number sequentially even if the preceding or folowing siblings are filtered?
On 1/8/07, J.Pietschmann <j3322ptm@xxxxxxxx> wrote:
xslt.new wrote: > 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.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format