xsl-list
[Top] [All Lists]

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

2021-09-22 12:16:42
On Wed, Sep 22, 2021 at 05:06:34PM -0000, Wendell Piez 
wapiez(_at_)wendellpiez(_dot_)com 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(_at_)gmail(_dot_)com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>