xsl-list
[Top] [All Lists]

Re: [xsl] XSLT 4 xsl:with

2020-05-20 23:11:43
On Tue, May 19, 2020 at 05:55:25PM -0000, Imsieke, Gerrit, le-tex 
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de 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(_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>