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

Re: Calculating groups of repeating elements

Subject: Re: Calculating groups of repeating elements
From: Quinn Dombrowski <qdombrow@xxxxxxxx>
Date: Thu, 11 Dec 2008 08:56:20 -0600
Re:  Calculating groups of repeating elements
Thanks for the warning, Ken. I'll scratch that approach off my list.

This is great, Michael! If I can sort the <word-group>s in some standard way (alphabetically?) across all the places, I should be able then to group the data processed from your xsl based on how many places have a given <word-group>.



G. Ken Holman wrote:
At 2008-12-10 18:42 -0600, Quinn Dombrowski wrote:
Thanks for looking at this! Sorry for not being as clear as I could've been with what I'm looking for. For the example data set, I'm trying to automatically generate an output something like this:

Aa + C + Qqq: 2 places (1, 3)
Aa + C: 3 places (1, 2, 3)
Aa + Zz: 2 places (2, 3)
C + Qqq: 2 places (1, 3)

So it lists all the groups of 2+ words that appear together in 2+ places. This list is sorted by length of the group (3 words is the maximum number of words that occurs in 2+ places in the sample data), but it'd be nice to also be able to sort by number of places:

Aa + C: 3 places (1, 2, 3)
Aa + Zz: 2 places (2, 3)
etc.

Sorry, that would be beyond my volunteer allocation for this morning ... too much going on right now.


I was using intersects to get places with Aa AND C AND Qqq (<xsl:value-of select="count(atlas/place/place_number[../words/word='Aa'] intersect atlas/place/place_number[../words/word='C'])"/>), but got overwhelmed by the number of ways I'd have to plug in all the different words to go through the data exhaustively-- the real data has 250+ places and 75+ words.

But for you and the archive, be aware that your concept of intersect above wouldn't help in the case of XSLT 2.0:


$a intersect $b

   returns those tree nodes in node set $a that are the same tree nodes
   found in node set $b ... not by value, but the nodes themselves.

For this reason an "Aa" node in place 1 would not be recognized as being the same as the "Aa" node in place 2 and would not be returned in an intersection.

I hope this steers you away from an unsuccessful approach.

. . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes:
:  Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg
Video course overview:  http://www.youtube.com/watch?v=VTiodiij6gE
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.