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

Re: XSLT 4 xsl:with

Subject: Re: XSLT 4 xsl:with
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 May 2020 04:17:40 -0000
Re:  XSLT 4 xsl:with
On Tue, May 19, 2020 at 06:10:56PM -0000, Wendell Piez wapiez@xxxxxxxxxxxxxxx scripsit:
> Does anyone else find themselves doing
> 
> <xsl:for-each-group select="some-node" group-by="true()">
>    .... inside I have current-group() ...
> </xsl:for-each-group>
> 
> -- which has sometimes made me wonder if group-by="true()" might be a
> default on for-each-group?
> 
> Or ... would <xsl:with>...</xsl:with> or <xsl:for>...</xsl:for> or
> <xsl:at>...</xsl:at> be a serviceable and better way to do this as
> well?

Wouldn't the equivalent be

<xsl:with-context select="some-node">
    ... stuff happens...
</xsl:with-context>

Using for-each-group gives you a sequence in current-group(); I would think that if you expect a sequence, you might-maybe be better to use xsl:for-each rather than xsl:with-context.  If I understood the original idea, it was a way to be less confusing by not using xsl:for-each in the singleton case.

If we were to allow modes on xsl:with-context, it'd be a way to do mode-based selection.

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

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.