xsl-list
[Top] [All Lists]

Re: [xsl] Can an XSLT 3.0 stylesheet access the complete sequence of values passed in as the initial match selection?

2020-01-12 13:43:57
You can only process the items individually; which I'm afraid makes the feature 
rather useless.

Perhaps an initial-match-selection() function might rescue it; but as Dimitre 
says, it's just as easy to set a global parameter.

Michael Kay
Saxonica

On 12 Jan 2020, at 18:15, Dimitre Novatchev dnovatchev(_at_)gmail(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:



On Sun, Jan 12, 2020 at 3:32 AM Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de 
<mailto:martin(_dot_)honnen(_at_)gmx(_dot_)de> 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com 
<mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>> wrote:

In https://www.w3.org/TR/xslt-30/#dt-initial-match-selection 
<https://www.w3.org/TR/xslt-30/#dt-initial-match-selection>, the XSLT 3 spec 
outlines:

 A stylesheet may be evaluated by supplying a value to be processed, together 
with an initial mode <https://www.w3.org/TR/xslt-30/#dt-initial-mode>. The 
value (which can be any sequence of items) is referred to as the initial 
match selection.

and 

specifically, each item in the input sequence is processed by selecting and 
evaluating the best matching template rule



Does a stylesheet have any way of accessing the whole sequence? Or is it only 
able to process each item in the sequence with a matching template?

For instance, if the initial match selection is a sequence of array items, is 
there any way to merge those arrays? The function array:join 
https://www.w3.org/TR/xpath-functions/#func-array-join 
<https://www.w3.org/TR/xpath-functions/#func-array-join> can join a sequence 
of arrays, but is there any way in that case of the initial match selection 
being a sequence of arrays to apply it to that initial match selection?


I think that the Specification doesn't answer this question.  

But the same can be achieved if you pass the desired sequence as a global 
parameter.

Cheers,
Dimitre Novatchev
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>