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

RE: Complex grouping problem, please help.

Subject: RE: Complex grouping problem, please help.
From: kakridge@xxxxxxxxxxxxx
Date: Sun, 11 Jan 2004 18:59:57 -0500
concatenate function in xsl
Well, I couldn't even understand what you typed, so the variable
approach probably is much better for me. :)  

I was able to make your solution work, so I appreciate your help. Thank
you for answering my questions; you have cleared up a lot of confusion
for me.

Thanks again,
Kenny Akridge

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of G. Ken
Holman
Sent: Sunday, January 11, 2004 1:39 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Complex grouping problem, please help.

At 2004-01-10 21:32 -0500, kakridge@xxxxxxxxxxxxx wrote:
>The approach I am taking with this has been to for-each the first
>occurrence of every tutor in Grade node.  I then for-each a key
matching
>all Students to based on each tutor.  I keep trying to only limit the
>key to the current grade, but I don't think it is working.

The software is working, your stylesheet is accessing all of the values
you 
don't want.

><xsl:key name="students-by-tutor" match="Grade/Students/Name"
>use="Tutor"/>

The above creates a *document-wide* key table.  You cannot subset the 
document-wide table when you use the key() function.

>What am I missing?

That the key() function has document-wide scope.

>The key doesn't seem to only return students in the
>given grade. It returns all students in all grades for the tutor.

Yes, it would, because of document-wide scope.

This message is timed only 9 minutes after I supplied the variable-based

grouping solution so was written without having seen my answer ...

   http://www.biglist.com/lists/xsl-list/archives/200401/msg00340.html

... but the message only just arrived in my mailbox hours late, but I 
thought I would answer the questions as I did above as they are valid 
questions.

The next question is, when not using my variable-based technique, how
would 
one use the Muenchian method to subset the document scope?  By 
incorporating in the key some value that is unique to the scope.  I used
to 
concatenate to the start of the lookup value the generate-id() of the 
ancestral apex of the subset of document scope, followed by a space (not
a 
name character), followed by the uniqueness within that scope.  That
relies 
on the key() function including both the ancestral apex identifier plus
the 
lookup value.  It all works, but it is a bear to maintain and to help 
someone who is reading the code understand what is going on ... I found
the 
variable-based method to be much easier to understand, read and
maintain.

I hope this helps.

............................. Ken

--
North America (Washington, DC): 3-day XSLT/2-day XSL-FO 2004-03-15
Instructor-led on-site corporate, government & user group training
for XSLT and XSL-FO world-wide:  please contact us for the details

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 0-13-140374-5                               Definitive XSL-FO
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:     http://XMLGuild.info
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


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


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


Current Thread
  • RE: Re:, (continued)
      • kakridge - Sat, 10 Jan 2004 11:00:55 -0500 (EST)
        • kakridge - Sat, 10 Jan 2004 12:30:28 -0500 (EST)
        • kakridge - Sat, 10 Jan 2004 21:33:22 -0500 (EST)
        • G. Ken Holman - Sun, 11 Jan 2004 13:39:28 -0500 (EST)
        • kakridge - Sun, 11 Jan 2004 19:00:18 -0500 (EST) <=
    • G. Ken Holman - Sat, 10 Jan 2004 21:24:06 -0500 (EST)
      • kakridge - Sat, 10 Jan 2004 23:42:42 -0500 (EST)

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.