[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Two-level grouping problem
<xsl:if test="generate-id(.)= There's a bit more going on here than a prior respondent wrote. As correctly noted, generate-id() returns an unique ID for a given node; thus generate-id(.) on the LHS computes an ID for the current node. The generate-id() on the RHS also computes an ID, but with some implicit constraints. Namely, $rows[...] returns all rows *in document order* whose TYPE and SUB_TYPE match those of the current node, and generate-id() returns the ID of the *first* of those nodes. The document order part is important, becuse it means the ID from the LHS will equal the ID from the RHS only when the node on the LHS is the first of its kind in the document. The idea is, we want to show only 1 each of nodes with the same TYPE, SUB_TYPE values. Thus, get a list of nodes, and cull out just the first of each such group. This is explained on the section on grouping at www.jenitennison.com. Not to confuse the issue, but you may see that we could as well use the value of the last() node of $rows[...] above to same effect. So what that outer loop does is end up with only those nodes whose TYPE and SUB_TYPE are the first of their kind, based on their respective @value attributes. The process is repeated for inner-values. Regards, --A From: Max Bronsema <max.bronsema@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Two-level grouping problem Date: Tue, 10 May 2005 11:26:13 -0600 _________________________________________________________________ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|
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
|