[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Formatting issues

Subject: Re: Formatting issues
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 22 Dec 2006 23:12:44 +0100
Re:  Formatting issues
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.