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

Re: Re: Grouping flat HTML at multiple levels

Subject: Re: Re: Grouping flat HTML at multiple levels
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Fri, 5 Oct 2012 09:26:57 -0400
Re:  Re: Grouping flat HTML at multiple levels
Hi Mark,

Unfortunately I don't have the time to work this out in detail at the
moment. But this is an interesting problem with at least two
solutions, each with its advantages.

The first solution is to group inside a group. It would work like this:

The outer for-each-group uses group-adjacent to collect "mixed lists":
any set of contiguous list items of either kind, possibly mixed
together. (They'll be mixed any time you have more than one contiguous
list.)

The inner for-each-group then sorts these out by grouping adjacent
again. This time, use a Boolean key value, something like this:

<xsl:for-each-group select="current-group()"
group-adjacent="@class=('ListNumber','ListNumberLast')">
 ...

Then inside this inner grouping, use xsl:choose to examine to see
which sort of group you have.

Method two is to pipeline or micropipeline. Pull out and group one
sort of list, bind the results to a variable, and apply templates to
the variable to pull out and group the second sort of list. You can do
this either at the level of the document or of the parent of the
lists. There are tradeoffs in this choice (micropipelining should be
more efficient but micropipelines don't give you access to the entire
tree so some sorts of operations are not possible without
workarounds).

With only two types of list, I'd probably go with the first method.
(Although it will handle more than one type if you can contrive a way
to assign distinct key values for the different kinds of lists.)

I'll try to stay on top of the thread but even if I can't, I'm sure
others can also help if you have followup questions. (As you might be
able to infer from the .sig, my life has recently changed. Yes, I'm in
a position to contract directly for XSLT-related services.)

Cheers,
Wendell

-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

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.