<?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>5338</bug_id>
          
          <creation_ts>2008-01-02 18:40:56 +0000</creation_ts>
          <short_desc>[UPD] Revalidation mode: which static context?</short_desc>
          <delta_ts>2008-02-05 23:50:03 +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>Last Call drafts</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="Michael Kay">mike</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</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>18179</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-01-02 18:40:56 +0000</bug_when>
    <thetext>The specification for upd:revalidate() describes the effect in terms of the revalidation mode &quot;in the static context&quot;. But which static context?

For a query that does updates at the top level, it should presumably be the revalidation mode defined in the main query module. For updates done within a transform (copy-modify) expression, it should presumably be the revalidation mode defined in the module containing the transform expression. 

(The description of revalidation mode says its scope is global. But it doesn&apos;t say what this means. Does it mean it&apos;s an error to define different values in different modules? If so, what error?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18301</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2008-01-15 01:43:35 +0000</bug_when>
    <thetext>I think the spec is reasonably clear on this. upd:revalidate() is invoked only by upd:applyUpdates, which in turn is invoked only by a top-level expression or by a transform expression. As usual, the processing of an expression is governed by the static context that is defined for that expression.

We probably don&apos;t want to raise an error if an imported module has a different revalidation mode from the importing module. This would make it difficult to write modules that can be called from different environments. Therefore we should change &quot;global&quot; to &quot;module&quot; in the description of revalidation mode in Section 2.3 (Extensions to the Static Context).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18600</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2008-01-26 22:09:58 +0000</bug_when>
    <thetext>Michael,
On 22 Jan 2008, the Query Working Group considered this bug report and decided to change the scope of Revalidation Mode from &quot;global&quot; to &quot;module&quot; as suggested in Comment #1. If you are satisfied with this resolution, please change the status of this bug report to Closed.
--Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18602</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-01-26 23:19:21 +0000</bug_when>
    <thetext>I&apos;m not convinced that the proposed change is sufficient to make it clear that (as Don states in comment #1)

(a) when we&apos;re dealing with a &quot;top-level&quot; updating query, the static context that applies is the static context of the top-level module

(b) when we&apos;re dealing with updates within a transform expression, the static context that applies is the static context of the module containing the transform expression.

Normally functions don&apos;t inherit the context of their caller. Don is suggesting, in effect, that it is &quot;reasonably clear&quot; that upd:revalidate() inherits the context of upd:applyUpdates(), and that upd:applyUpdates() in turn inherits the context of either the top-level expression or the transform expression. 

Well, it may be clear to the author of the spec, but I don&apos;t think that necessarily makes it clear to the reader. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18781</commentid>
    <comment_count>4</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2008-02-05 23:49:52 +0000</bug_when>
    <thetext>On 05 Feb 2008 the Query Working Group reconsidered this issue and approved the following resolution which was proposed by Michael Kay:

1. Give the functions upd:applyUpdates() and upd:revalidate() an extra argument:
 
$reval as revalidation-mode
 
explaining that this takes the value strict, lax, or skip
 
2. Change clause 5 of 3.2.2 upd:applyUpdates to say:
 
For each document or element node $top that was marked for
revalidation by one of the earlier steps, upd:revalidate($top, $reval) is
invoked.
 
3. In 3.2.3 upd:revalidate, change references to &quot;revalidation mode [in the
static context]&quot; to refer to $reval
 
4. Change clause 3 of 2.4.5 transform to start &quot;Let $reval be the value of
the revalidation mode in the static context of the transform expression. The
following update operation is invoked: upd:applyUpdates($pul, $reval).
 
5. In 2.1 processing model, change rule 3. Replace &quot;If the outermost
expression in a query returns a pending update list, upd:applyUpdates is implicitly applied to this pending update list. &quot; by &quot;If the outermost expression in a query returns a
pending update list, upd:applyUpdates is implicitly called, supplying as
arguments (a) the pending update list, and (b) the value of the revalidation
mode in the static context of the main query module.
 </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>