This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Functional why do we need copy? "transform $" is like "for $" unambiguous. The following looks closer to FLWR: transform $je := $e modify do delete $je/salary return $je And we would like to have the syntax changed in this way.
The keyword "copy" was introduced for a reason. The ":=" operator normally does not make a copy. Instead, if there are nodes on the RHS, the variable on the LHS is bound to references to these nodes. The variable can then be used, for example, to navigate to the parents of these nodes. In contrast, the COPY clause of a transform also uses the ":=" operator but it makes an actual copy of the nodes on the RHS. The keyword is helpful to emphasize this distinction. --Don C.
What about something like this? copy $je := $e transform do delete $je/salary return $je That maintains the semantics of "copy", and puts the transformation keyword where the transforms occur.
In today's face-to-face meeting, we adopted the following syntax as our resolution of this issue: TransformExpr ::= "copy" "$" VarName ":=" ExprSingle ("," "$" VarName ":=" ExprSingle)* "modify" ExprSingle "return" ExprSingle Jonathan
Jonathan intended to mark this bug FIXED, then CLOSED