<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6221</bug_id>
          
          <creation_ts>2008-11-12 19:19:50 +0000</creation_ts>
          <short_desc>[UPD] transform modify clause</short_desc>
          <delta_ts>2011-01-10 18:50:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Update Facility</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Eisenberg">andrew.eisenberg</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22416</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2008-11-12 19:19:50 +0000</bug_when>
    <thetext>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]. ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22537</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2008-11-25 17:59:00 +0000</bug_when>
    <thetext>The WG agreed to accept this change.

Jonathan</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>