Re: [xsl] XSLT 4 xsl:with

Subject: Re: [xsl] XSLT 4 xsl:with
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 May 2020 04:11:37 -0000
On Tue, May 19, 2020 at 05:55:25PM -0000, Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx scripsit:
> But read my previous messages in this thread. Instead of xsl:with I propose
> to use a @context-item attribute (an @xsl:context-item attribute on non-xsl
> elements). If you really need the kind of wrapper that xsl:with provides,
> you can still write
> 
> <xsl:sequence context-item="$context">
>   <xsl:variable .../><!-- @select evaluated in the context of $context -->
>   <foo>...</foo><!-- any expression within is also evaluated in the context
> of $context -->
>   <bar>...</bar>
> </xsl:sequence>

Is the context item a property of the instruction or a circumstance of the executing transform?

I think @context-item makes the context item a property of the instruction with which the context-item attribute is associated, and since I view the context item as a circumstance of the transform executing, I get some philosophical dissonance from the idea.

I also like the idea of having an explicit container element for a change of context; this may be a long-term side effect of early run-ins with the implicit context of position(), but I'll take easy to read over compactness of expression in XSLT.  (Which will never be all that compact unless someone decides to create processing for an alternative, XQuery-ish, sort of syntax.  (And now I have a mental image of the syntax you'd get by colliding Haskell and XQuery. I should stop.))

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

Current Thread