xsl-list
[Top] [All Lists]

[xsl] Counting when using xsl:key in nested values

2008-10-29 10:49:24
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(_at_)xxx(_dot_)com


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Counting when using xsl:key in nested values, Peter Sherwood <=