This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In 2.4.5 Transform, bullet 2, we say: 2. The modify clause must contain either an updating expression, an empty expression ( ), or a call to the fn:error function; otherwise a static error is raised [err:XUST0002] ... In 2.2.3 Function Declaration, bullet 2.b., we say: b. If external is not specified, the EnclosedExpr in the function declaration must be an updating expression or a vacuous expression; otherwise a static error is raised [err:XUST0002]. In D.1 New Error Codes, we say: err:XUST0002 It is a static error if a simple expression that is not a vacuous expression is used in one of the following positions: 1. The modify clause of a transform expression. 2. The top-level expression in the body of a function declaration in which the keyword updating is specified. Our statement in 2.4.5 Transform is not aligned with either the definition of XUST0002 nor the other use of XUST0002 in 2.2.3 Function Declaration. Consider the following query: copy $e := $external_y modify if (true) then () else fn:error() return $e This would be disallowed by bullet 2, but allowed by XUST0002. I suggest that bullet 2 be changed as follows: 2. The modify clause must [insert: be an updating expression or a vacuous expression] [remove: contain either an updating expression, an empty expression ( ), or a call to the fn:error function] ; otherwise a static error is raised [err:XUST0002]. ...
The WG agreed to accept this change. Jonathan