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

Re: Value of variable not appearing in the <xsl:other

Subject: Re: Value of variable not appearing in the <xsl:otherwise> of xml:choose
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Sep 2021 18:33:26 -0000
Re:  Value of variable not appearing in the  <xsl:other
Hi again,

What Graydon says is totally true, but the counter is also true, that it
can be amazing what grouping *can* be made to do and problems it can solve
that you didn't think were grouping problems but actually are.

This actually includes overlap problems, as Gerrit (just to name one) has
also shown. One of my favorite patterns is group-adjacent with a function
as a grouping key.

Cheers, Wendell




On Wed, Sep 22, 2021 at 1:17 PM Graydon graydon@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, Sep 22, 2021 at 05:06:34PM -0000, Wendell Piez
> wapiez@xxxxxxxxxxxxxxx scripsit:
> > Another optimization to consider is to group using
> > group-adjacent="@class='analyze_visual'" returning a Boolean grouping
> key,
> > and groups that are nicely split.
> >
> > Then part/@num should collapse into '{position()}' and things get
> simpler.
> > Also gracefully handles the case of multiple splits.
>
> Especially if you find Wendell's observation above covers your use
> cases, it won't apply this time, but in general, I find that if I'm
> struggling with xsl:for-each-group, I should -- and sometimes I even do!
> -- remember that xsl:for-each-group is not fully general. There comes a
> time to write one's own recursive grouping function for this particular
> case.
>
> Which sounds awful, but is generally much simpler than it feels like it
> ought to be and is highly preferable to trying to make
> xsl:for-each-group cover a case it can't cover.
>
> --
> Graydon Saunders  | graydonish@xxxxxxxxx
> CC&s oferC)ode, C0isses swC! mC&g.
> -- Deor  ("That passed, so may this.")
>
>
>

--
...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.