|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Trying to pull of a double Muenchian
Thomas,
Muenchian grouping gets complex and ugly (or: uglier ;-) when it goes to multiple levels, because keys have document-wide scope. So in your case, for example, to avoid the problem you describe, the second key would have to be a "compound" key, as in <xsl:key name="product" match="/csv_data_records/record" use="concat(item[2], item[4])"/> and called accordingly. However, there may be other, nicer methods. See the approach Ken Holman has tried to instill in our minds, variable-based grouping, as described at http://www.biglist.com/lists/xsl-list/archives/200401/msg00070.html Basically the idea is to use variables to collect together all the nodes to be grouped, and to select from those variables to collect your subgroups. It goes to multiple levels much more nicely. Note that construing Ken's code does require understanding that generate-id(.)=generate-id($games[game=current()/game]) is the same as generate-id(.)=generate-id($games[game=current()/game][1]) Another alternative that may be available to you: use XSLT 2.0. Cheers, Wendell At 09:03 AM 2/28/2006, you wrote: I have found various suggestions on this list, and links to more explanatory pages describing the Muenchian technique to sort or group xml data. ====================================================================== 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 ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






