This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29333 - Higher-order functions and updates.
Summary: Higher-order functions and updates.
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2015-12-11 16:48 UTC by Christian Gruen
Modified: 2016-03-22 09:53 UTC (History)
0 users

See Also:


Description Christian Gruen 2015-12-11 16:48:21 UTC
In the XQFO spec – or in the XQUF spec? – it should probably be mentioned what is going to happen if an updating function is supplied to a higher-order function. Examples:

  apply(function() { delete node <a/> }, [])

    function($node, $uri) { fn:put($node, $uri) }

Maybe XPTY0004 could be raised?
Comment 1 Michael Kay 2016-01-05 15:55:02 UTC
XQuery Update 3.0 states:

A FunctionTest without an updating function assertion only matches simple functions as it does in unextended XQuery 3.0.

The signature of higher-order functions defined in F+O does not include an updating function assertion, and therefore updating functions cannot be supplied as arguments to functions such as apply() and for-each-pair().

Since the spec states that an updating function "is not matched", I think this implies that XPTY0004 is raised.
Comment 2 Michael Kay 2016-01-05 16:22:06 UTC
The WG agreed with my response, and decided to close as WORKSFORME. Please re-open if you think we've got it wrong.