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

Re: "sorted" axis (was: Remove duplicates from a node-set ac

Subject: Re: "sorted" axis (was: Remove duplicates from a node-set according to content)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 30 Jul 1999 11:30:14 +0100 (BST)
removed duplicated source ac
> I'm not sure an empty element feels right: there's a need to delineate the
> processing that happens at each level of grouping, something like:
> ...
> The other thing I haven't done (which is really why I made the remark about
> report writers) is to link it in with totalling; with updatable variables
> it's easy enough to accumulate subtotals at each grouping level, but without
> them, it's a little tricky to show a subtotal over the items in a group.

grouping and totalling would be easy enough if you could first sort the
input and then just walk over the sorted tree again with some more
templates, perhaps in a different mode (or perhaps not, if the result
temlates already had nodes distinct from the source tree, eg from a
different namespace)

ie if you could go
<xsl:variable name="firstpass">
 <xsl:for-each, or apply-templates or whatever
  <xsl:sort something...
</xsl:variable>

which gives you a `result tree fragment' in $firstpass, but then to
think of that as an _input_ tree, something like

<xsl:apply-templates mode="secondpass" select="$firstpass"/>

once the nodes are in sorted order, it is easy enough to put
containing elements around consecutive groups, and to do running totals
etc. (actually grabbing consecutive things into a containing group may
not be completely obvious, but it isn't hard, and one would hope that
over time the archive of useful named templates could be built up to do
this sort of thing, rather than having to keep extending the language)


David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.