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

Re: exercise in complex grouping

Subject: Re: exercise in complex grouping
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 May 2020 15:32:00 -0000
Re:  exercise in complex grouping
Hey Syd,

With apologies for lateness: maybe this is now "moot" in the American
sense. But an idea.

I would try this by writing a function: it could return a Boolean
value, true() or false() depending on whether a node should be judged
to be "sticky". f:sticky(.), in other words, would be true for any
node that was either a B, or an A pointing to a B, or anything
between. Is there a B anywhere, in other words, to which this node
should stick? Or perhaps for stronger code, it would return not a
Boolean, but the value of a relevant A/xml:id. Yup: this would be
better, since it would also break out any adjacent B/A pair-groups
from one another. So, f:sticks-to-id().

In complicated cases the function might have to perform a sibling
recursion, although in your case it could perhaps simply inspect
sibling nodes, finding any Bs with their As, then use >> or <<
comparison operators against those pairs.

Given such a function, for-each-group/@group-adjacent should work.
Plus, since the core logic is in the function, it's easier to test and
repair for any edge cases.

The code to detect any Bs that have wandered away from their As should
not be too hard either, to help ensure coverage.

Cheers, Wendell


On Tue, May 12, 2020 at 11:47 AM Syd Bauman s.bauman@xxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> To:   Geert Bormans  and  David Carlisle
> From: Syd
> Re:   complex grouping suggestions
>
> Gentlemen --
>
> Thank you so much! As you might guess, it will take me awhile to work
> through your suggestions, tweak to match the actual data, and test.
> But I'm on it, and very appreciative.
> 



-- 
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

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.