xsl-list
[Top] [All Lists]

Re: [xsl] XSLT 4 xsl:with

2020-05-19 03:58:24
Yes. Little things like this can make a big difference. We've tried to 
eliminate cases (e.g. xsl:number, xsl:copy) that force you to set the context 
item, so the need for this is perhaps less than it was, but I can still see it 
being handy.

Michael Kay
Saxonica

On 19 May 2020, at 09:54, Pieter Masereeuw pieter(_at_)masereeuw(_dot_)nl 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Just something that I've always wanted to bring up, but always hesitated to 
do because I don't know if it's really worthwhile:

I often find myself using xsl:for-each for no other purpose than merely 
setting the context, e.g., in order to call a named template or to simplify a 
set of XPath expressions.

Because such a for-each does not repeat, I always add a comment like <!-- 
Merely sets the context, does not repeat -->.

I would be very happy if I could make my intentions clearer by using a real 
XSLT construct in this situation, such as <xsl:with select="...">. The 
semantics could also help as an assertion that, indeed, the selection has 
exactly length 1.

The proposed name comes from my first computer language, Pascal.

Pieter Masereeuw

XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by 
email <>)
--~----------------------------------------------------------------
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>