Re: [xsl] Value of variable not appearing in the <xsl:otherwise> of xml:choose

Subject: Re: [xsl] Value of variable not appearing in the <xsl:otherwise> of xml:choose
From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Sep 2021 19:54:17 -0000
And dont forget xsl:iterate as an alternative to recursive functions or
templates (if you can use XSLT 3).

Cheers,

Eliot
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>

From: Wendell Piez wapiez@xxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wednesday, September 22, 2021 at 1:33 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Value of variable not appearing in the <xsl:otherwise> of
xml:choose
[External Email]

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<mailto:graydon@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>> wrote:
On Wed, Sep 22, 2021 at 05:06:34PM -0000, Wendell Piez
wapiez@xxxxxxxxxxxxxxx<mailto: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<mailto:graydonish@xxxxxxxxx>
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")



--
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez.<https://urldefense.com/v3/__http:/github.com/wende
llpiez.__;!!N4vogdjhuJM!STJELpeWTl7S3m-lHIYu02PfkNtB2NjAftWg3meozdDuHjS1sfvWu
nTfw_ayKrkOwlZ-CA$>.. ...gitlab.coko.foundation/wendell...
XSL-List info and
archive<https://urldefense.com/v3/__http:/www.mulberrytech.com/xsl/xsl-list__
;!!N4vogdjhuJM!STJELpeWTl7S3m-lHIYu02PfkNtB2NjAftWg3meozdDuHjS1sfvWunTfw_ayKr
mKgh2nfw$>
EasyUnsubscribe<https://urldefense.com/v3/__http:/lists.mulberrytech.com/unsu
b/xsl-list/3453418__;!!N4vogdjhuJM!STJELpeWTl7S3m-lHIYu02PfkNtB2NjAftWg3meozd
DuHjS1sfvWunTfw_ayKrmUFIg4vg$> (by email<>)

Current Thread