xsl-list
[Top] [All Lists]

Re: [xsl] Random UUID in pure XSLT?

2020-11-12 10:14:34
I think these functions should not be deterministic.

Informally, and going all the way back to 1.0, I think the XSLT view is
that the world doesn’t change while the transformation is running.
Consider, for example, that fn:current-dateTime() is fixed!

This simplifies *a lot* of things.

Imagine the traditional publishing scenario where you’ve got some
modules that format the chapters and some modules that format the table
of contents, and some modules that format the indexes.

Suppose that each one of these modules does an fn:doc() to get at
metadata or even at parts of the document. If you admit the possibility
that fn:doc() could return different results, then you have an
essentially indeterminate publishing system. What do you get if you
format a document? It depends.

From one point of view, that’s right, it depends. But this kind of
uncertainty would creep in when you least expected it, in ways you
didn’t anticipate, and bite you.

And if you wanted to fix the issues, you’d potentially have to do a lot
of work and introduce a lot of code dependencies across modules that
would be easier to test and maintain if they were independent.

Is it very occasionally inconvenient that fn:doc() and related functions
are static? Yes, it is. But that’s pretty uncommon for most users. The
fact that fn:doc() is static means you never have to worry about
concurrency and side effects. Is that convenient? It sure is.

                                        Be seeing you,
                                          norm

--
Norman Tovey-Walsh <ndw(_at_)nwalsh(_dot_)com>
https://nwalsh.com/

The trip doesn't exist that can set you beyond the reach of cravings,
fits of temper, or fears. If it did, the human race would be off there
in a body.--Seneca
--~----------------------------------------------------------------
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
--~--

Attachment: signature.asc
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>