Re: [xsl] XSLT repetition constructs

Subject: Re: [xsl] XSLT repetition constructs
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Mar 2019 16:15:20 -0000
On Wed, Mar 6, 2019 at 5:01 AM John Lumley john@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> > All of these are *mapping" operations, like the map function in
> > Haskell. These have nothing to do with repetition.
>
> Note that the XSLT3.0 specification does actually describe these under a
> chapter heading "Repetition".....
>

Then this is a mistake in the specification -- time for errata.
Repetition implies time passing during the transformation and there is
no notion of "passed time" or time-ordering of execution in XSLT. This
was by design. In fact special care was taken so that functions like
current-time() always return the same value during transformation.

To put it in other words, if we apply templates to a set of items and
output (using <xsl:message/>) the value of current-time() within the
selected template for each item, we get the same value -- so all these
operations were executed at the same time...  This definitely is not
"repetition"

> And one can consider a mapping over a finite set of domain points as
> 'repeat this function over each of these points' ....

"Repeat" means do something first and then do it again. If we do not
specify what is to be done "first" then we cannot speak about
repetition.

It would be correct to say instead: "**Apply** this function on each of these"

Cheers,
Dimitre

>
> On 05/03/2019 22:17, Dimitre Novatchev dnovatchev@xxxxxxxxx wrote:
> > It isn't correct to use "repetition" for a set of operations that are
> > independent from each other and can be executed in any order or in
> > parallel.
> >
> > In this group fall such operations as <xsl:for-each>. the XPath for
> > expression, the ! (bang) operator and applying a function in the last
> > location step of an XPath step-expression (sorry if I don't remember
> > the exact terminology).
> >
> > All of these are *mapping" operations, like the map function in
> > Haskell. These have nothing to do with repetition.
>
> Note that the XSLT3.0 specification does actually describe these under a
> chapter heading "Repetition".....
>
> And one can consider a mapping over a finite set of domain points as
> 'repeat this function over each of these points' ....
>
> --
> *John Lumley* MA PhD CEng FIEE
> john@xxxxxxxxxxxx <mailto:john@xxxxxxxxxxxx>
> on behalf of Saxonica Ltd
> 



-- 
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.

Current Thread