Subject: Re: [xsl] [XSLT2] Some common, generic grouping problems From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Fri, 30 Jun 2006 11:59:46 +0100 |
andrew welch wrote:
><root> > <arbitrary /> > <elem color="dark-red" /> > <elem color="red" /> > <arbitrary color="none" /> > <elem color="red" /> > <elem color="light-red" /> > <arbitrary /> > <elem color="dark-red" /> > <elem color="red" /> > <arbitrary color="none" /> > <elem color="red" /> > <elem color="light-red" /> > <arbitrary /> ></root> [...] >That is of course if I've scaled up the input correctly, no comment >from the OP so far.
Yes, this is how the input would scale. I'm sorry for not replying earlier to the solutions given so far (Andrew, David) - I must admit that I am still digesting the code given to extract and understand the underlying idea(s).
For your (Andrew's) solution to example #1, am I right that the underlying idea could be paraphrased as:
"Group by start, then tail-trim the resulting groups to end (using a nested grouping from end)"?
Yes - I would call it "intersecting" rather than "trimming", its providing the end marker for the group. The elements that aren't in the intersect are copied to the result (in the xsl:otherwise blocks) so trimming might give the wrong impression.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [XSLT2] Some common, gene, Christian Roth | Thread | Re: [xsl] [XSLT2] Some common, gene, David Carlisle |
Re: [xsl] [XSLT2] Some common, gene, Christian Roth | Date | Re: [xsl] Moving (promoting) XML el, Mark Peters |
Month |