Jens Teubner wrote:
On Wed, Jul 9, 2008 at 9:41 AM, Sjoerd Mullender
wrote: empty-sequence() doesn't seem to be the right return type for fn:put(). Pathfinder decides the validity of updating expressions slightly different than the W3C specs (and, in my eyes, much more consistent). The thing is, fn:put() is *not* an updating expression. It is defined in the same document by the same committee, but not in the same section as the updating expressions.
Hi Sjoerd,
I don't agree with this conclusion. fn:put() is defined in the same section (Section 2) as all the other update expressions. fn:put() has a side effect just as all the other update expressions.
There's an additional Section 3 that describes the underlying primitives that implement the ones from Section 2. But this is unrelated to the issue.
Section 2 describes the extensions of the XQUF to XQuery 1.0. Section 2.6 describes the extensions to the built-in function library. There is one extension described there: fn:put(). Nowhere does it say there that this is an updating function. Read it.[1] You *cannot* conclude from the text there that fn:put() is an updating function, since if it were, it would say so there. It may be that in older draft versions of XQUF fn:put() was defined as an updating function (although if it was, I can't find it, and I went back the list of Previous versions), but in the final recommendation it is not, and that is all that counts. Apart from this, fn:put() also doesn't make sense as an updating function since it doesn't change anything in the document. [1] http://www.w3.org/TR/xqupdate/#id-new-functions -- Sjoerd Mullender