xsl-list
[Top] [All Lists]

Re: [xsl] generic grouping without nesting for-each-group?

2010-07-28 09:15:20
On Wed, Jul 28, 2010 at 14:45, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
Well, I wouldn't suggest nesting for-each-group 3 levels deep - I would
suggest doing it recursively so it can go any number of levels deep, along
the lines of

Yes, really for anything over a couple levels that makes more sense...
you are right.

http://www.saxonica.com/papers/ideadb-1.1/mhk-paper.xml

Thanks for this, I'd not read it and it will now make some bedtime reading :-)

That leaves the problem of the bad nesting of level numbers. But I don't
think that's actually a problem. If you look at my solution in that paper
(the recursive template called process-level) I think that when you skip a
level, it will simply put everything in one group, and carry on to process
the next level.

Another solution we thought of is to add in dummy head levels in an
additional first-pass.  So the first pass would add in any extra
<head> elements based on the difference between it and the previous
head.  So
<head level="1>
...
<head level="5">

would get <head> of levels 2-4 added immediately before it.  Then the
grouping itself becomes really quite simple.

Many thanks,

-James

--~------------------------------------------------------------------
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>
--~--