Re: [xsl] Formatting issues

Subject: Re: [xsl] Formatting issues
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 22 Dec 2006 23:12:44 +0100
ms wrote:
Level1 - 1,2,3 etc
Level2 - A, B, C
Level3 - i,ii,..
Level4 - (1), (2)
Level5 - (a), (b)
Level6 - (i), (ii)

Aha. Well, just add more templates to my base template.


The hierarchy for levels is that level 1 is the parent
for level2, level2 is he parent for level3 and so on.
i.e.

[...]

Now in an XML , there can be any number of these
levels, and I have a logic to filter these levels
based on certain conditions.

I see. So that part is working. Send your XSLT for where it is not working. Make the smallest possible example that does not work, and add the input, too. Also, add an example of what the output is that you expect.


I tried <xsl:number from="level1" format="1"/>
But that only numbers all levels with 1 and does not
increment them sequentially.

Indeed. In your <xsl:template> where you match for "level1", add a variable with one <xsl:number /> instruction in it. That's your counter (see my example).


This is my problem. How do I write the XSLT to
basically check if previous levels have satisfied the
filtering condition

This is what my XSLT is about. You can use it for that. Though I assume you will have to use the your own XPath expressions in the matches.


and if they have, include them for
counting, else remove them and count only those levels
that satisfy the condition and count sequentially.

Which is what it does, too ;) Your conditions will likely be different, though.

Please send what you've got (minimized to your problem domain).

Cheers,
-- Abel

Current Thread
  • [xsl] Formatting issues
    • ms - Fri, 22 Dec 2006 08:59:31 -0800 (PST)
      • Abel Braaksma - Fri, 22 Dec 2006 22:15:27 +0100
        • ms - Fri, 22 Dec 2006 13:35:54 -0800 (PST)
          • Abel Braaksma - Fri, 22 Dec 2006 23:12:44 +0100 <=
          • ms - Tue, 26 Dec 2006 06:18:20 -0800 (PST)
          • Shailesh Shinde - Wed, 27 Dec 2006 20:13:55 +0530
          • Abel Braaksma - Wed, 27 Dec 2006 17:43:48 +0100
          • ms - Wed, 27 Dec 2006 09:58:12 -0800 (PST)