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

Counting when using xsl:key in nested values

Subject: Counting when using xsl:key in nested values
From: Peter Sherwood <PeteJ@xxxxxxxxxxxxxx>
Date: Wed, 29 Oct 2008 07:48:55 -0700 (PDT)
 Counting when using xsl:key in nested values
Hi All,

(using xsl1.0)
I've been using the procedure described in the following link to organise data that needs to be collated in a grouped manner.

http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200201/msg00316.html

That works pretty well and produces my list in the correct grouped manner.
My problem is now is that the pesky designers want each row coloured. Great! I'll use position() mod != 1 blah.....

Oh no I won't. 

Due to the fact that I now have two levels of grouping the position() gets completely lost when I'm at the row level. I can  get the id of my entry with generate-id() but I don't know how many non-unique entries I have skipped. Therefore I can't know how many rows I've had previously. 
The same applies for some recursive routine, I just don't know which rows I have avoided.
I won't ask why I can't reassign a "variable" :-). Although I understand the reasons behind not being able to reassign one I invariably find it generates more potentially buggable, harder to read code rather than reduce it.

So any ideas how I can perform a count of what has gone before (using the original example is fine)? Is this only possible in XSL 2.0?

Pete Sherwood
petej@xxxxxxx

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.