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 6221 - [UPD] transform modify clause
Summary: [UPD] transform modify clause
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 19:19 UTC by Andrew Eisenberg
Modified: 2011-01-10 18:50 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2008-11-12 19:19:50 UTC
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]. ...
Comment 1 Jonathan Robie 2008-11-25 17:59:00 UTC
The WG agreed to accept this change.

Jonathan