xsl-list
[Top] [All Lists]

Re: [xsl] [saxon] Questions about the `saxon:threads` extension attribute

2020-01-02 18:02:44
A saxon:unordered attribute on the xsl:for-each itself would be much more
robust.

Yes!  This would be a **Great** feature.

Thanks,
Dimitre

On Thu, Jan 2, 2020 at 3:22 PM Michael Kay mike(_at_)saxonica(_dot_)com <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:



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

(1) fn:unordered doesn't relate very well to xsl:for-each because
functions can't be applied directly to instructions; it would make more
sense,
I think, to add a saxon:unordered attribute to xsl:for-each.  I don't
think it's a particularly easy change to make, given the existing code,
though I'm sure it could be done. One question is whether the result
corresponds to some permutation of the input sequence,
or to some permutation of the output sequence (that is, are the
multiple result items corresponding to one input item
deliverered in the "correct" order? Getting that right depends on
understanding the use cases, and I'm not sure I do...

In this case we need a permutation of the input sequence.

More precisely, we need fn:unordered($vmultithreadingResults) to produce
the items in $vmultithreadingResults in the order that they are being
produced


The problem there is that before evaluating the for-each in unordered
mode, we need to know that all references to the variable don't care about
ordering. That kind of analysis isn't impossible, but it's also rather
fragile; you only need to add an xsl:message that prints the contents of
the variable, and you change the way it's evaluated, with no visibility as
to why adding diagnostics has changed the result. A saxon:unordered
attribute on the xsl:for-each itself would be much more robust.

Michael Kay
Saxonica
XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/782854> (by
email <>)



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write
all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
--~----------------------------------------------------------------
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>