[xsl] Re: Unions and/or temporally related groups

Subject: [xsl] Re: Unions and/or temporally related groups
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 12 Jul 2001 23:32:33 -0700 (PDT)

I still need to see what is the exact output you expect from the xml fragment (not
well formed xml document!) you provided in your message.

Dimitre Novatchev.

Tony Click wrote:

I've searched the sites and haven't found an answer that solves my problem
and it may be that what I want to do cannot be done in XSL, but here's the

I have an xml document that has a tremendous amount of time ordered data.
The temporal order is essential to the report.  Additionally the data is
comming from multiple channels and there is a grouping based on the channels
being sent.  To make it even more complex there is also a grouping within a
channel as a channel's parameters change.  Here is some XML to help explain:

<time value="12:00:00">
	<data value="123" channel="1" parameterSet="1"/>
	<data value="123" channel="2" parameterSet="2"/>
<time value="12:15:00">
	<data value="234" channel="1" parameterSet="1"/>
	<data value="456" channel="2" parameterSet="2"/>
<time value="12:30:00">
	<data value="234" channel="1" parameterSet="3"/>
	<data value="456" channel="2" parameterSet="2"/>
<time value="12:45:00">
	<data value="234" channel="1" parameterSet="3"/>
	<data value="456" channel="2" parameterSet="4"/>
<time value="13:00:00">
	<data value="234" channel="1" parameterSet="3"/>

When generating html, I essentially need to create a 2 column table (rows by
time, columns are channels) and break the table every where the is a
discontinuity; where a discontinuity occurs between <time> elements when the
next time element does not contain the same number of data elements with the
same channel and parameterSet attribute values.  In the previous example
there is a discontinuity between 12:15 and 12:30 because the parameterSet of
channel 1 changed to 3.  There is a discontinutity between 12:30 and 12:45
because the parameterSet of channel 2 changed.  There is discontinuity
between 12:45 and 13:00 because there is no data for channel 1.

I have a solution to the problem which involves an <xsl:if> (I know, not
pretty!) and basically I want to do an intersection of the values of the
current time elements data elements channel attributes  (
$currentTime/data/@channel ) with the same attributes of the next time
element.  Unfortunatly it appears that despite the fact that the attributes
are named the same and even when their values are the same a union results
in four nodes.  So I suppose what I need to know how to do is how do I get
an intersection of nodes based on value not identity?

Also, I'm open to solving this problem other ways.  I've explored using
keys, but keys only allows basically grouping by one key where I need
grouping by two keys (channel and parameterSet).

I suppose there is one more constraint; I'm working with hundereds of
thousands of data elements and I need to be able to process them in seconds
not minutes.

Any ideas???



Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

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

Current Thread