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

Re: best-technique for selective group and merge?

Subject: Re: best-technique for selective group and merge?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 02 Mar 2004 14:29:34 -0500
Re:  best-technique for selective group and merge?
At 12:44 PM 3/2/2004, Ken wrote:
At 2004-03-02 08:43 -0800, James A. Robinson wrote:
The feature can contain multiple configs,
each of which I want to merge across features:
...
I want to be able to select /config_datastore/site/* and perform selective
grouping (on feature @name) and merging (on the feature/config elements)
to return:
...

I found I could wrap my head around this problem using variables instead of keys. An example is below giving your desired results. Note how I take advantage of the node-set comparison of a single value to a set of values to get from all configs only those whose feature's name is in a set of names.

I like this solution. What had occurred to me is to key directly to parameters, using a compound key value of its configuration id as well as feature name. But I think Ken's solution is cleaner and more elegant.


It's a case where variable-based grouping such as Ken demonstrates from time to time on the list has advantages over key-based grouping. Maybe we think of key-based grouping (or Muenchian document-scoped solutions in general) because we've gotten used to that pattern, and haven't quite internalized the other approach. But I'm making it a point to study the variable-based solutions when I see them, since this bias (at least on my part) almost undoubtedly comes from the natural inclination to do what I know works despite its being more cumbersome and difficult than a less-familiar alternative, even when that alternative is both cleaner, and arguably closer to the "spirit" of XSLT.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.