Action A-660-07: fn:put()

Action A-660-07: Jonathan to kick off an email discussion on Bug 29959, trying to create a proposal for fn:put().

I put this into the bug report (https://www.w3.org/Bugs/Public/show_bug.cgi?id=29959#c11).

Jonathan

Jonathan Robie 2016-11-14 23:15:31 UTC

I think we need to do *something*.  fn:put() was available with XQuery Update 1.0, and we don't have XQuery Update 3.1 yet.  And the ability to create multiple files as the result of a query is a rather fundamental one.  We shouldn't tell people they have to use XSLT if they want to do that.

Here are the possible choices that I see:

1. Eliminate fn:put() from XQuery 3.1.  As I indicate above, I don't think this is acceptable.

2. Add fn:put() to F&O 3.1, indicating that implementations SHOULD treat it as though it contributes to the result of the query even though it does not return a value.  This kind of special casing is not usually a great idea, but it may be the simplest way to provide the desired functionality.  This probably corresponds to what implementers will do if we do nothing.

3. Modify the signature of fn:put() so that it actually does return a value that changes the query result in addition to the side effect.  This is undesirable because (a) it differs from the definition of fn:put() in XQuery Update 1.0, and (b) it requires the ability to return a value and a pending update from the same function, something we will probably have in XQuery Update 3.1, but which never made it into the XQuery 1.0 specification.

None of these are great options, but I think special casing the function as in #2 makes the most sense, and corresponds to the semantics we would want in the XQuery Update 3.1 specification when it is finished.

Received on Monday, 14 November 2016 23:20:03 UTC