Re: [xsl] A challenge.. Group Periods of Data (1..5, 2..8, 4..9) (10..12; 10..14

Subject: Re: [xsl] A challenge.. Group Periods of Data (1..5, 2..8, 4..9) (10..12; 10..14
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Wed, 04 May 2005 20:53:21 +0000
As they say, those who can, do, and those who can't, teach. Thus perhaps I could annotate the solution below:


From: Karl Stubsjoen <kstubs@xxxxxxxxx>

1)  Variable e2 select.
select="@period_end[. &gt; $e]|$e[. &gt;= current()/@period_end]"

How does the pipe work here and is this only evaluating the current B
element, or evaluating all @period_end(s)?

$e is a passed-in param; so this expression selects either current <B>/@period_end if greater than $e, or simply the passed-in $e if it's equal-or-greater than the current <B>/@period_end. Remember that the pipe, "|", indicates "union", not "or" as in many programming languages.



2)  Right off the bat (first iteration), I don't understand how you
determine the period attribute "ends" value.

It assumes the period ends with the @period_end of the first <B>, until proven wrong further downstream.


3)  Variable g select, what does this get you, the ancestor record?
select="/.."

Current Thread