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 4540 - [UPD] Section 2.4.5 Transform: simplifying syntax
Summary: [UPD] Section 2.4.5 Transform: simplifying syntax
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-04 23:38 UTC by Michael Rys
Modified: 2007-07-26 22:09 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Rys 2007-05-04 23:38:36 UTC
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.
Comment 1 Don Chamberlin 2007-05-14 04:29:58 UTC
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.
Comment 2 Jonathan Robie 2007-06-12 16:15:11 UTC
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.
Comment 3 Jonathan Robie 2007-06-29 14:42:38 UTC
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
Comment 4 Jim Melton 2007-07-26 22:09:27 UTC
Jonathan intended to mark this bug FIXED, then CLOSED