<?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>6094</bug_id>
          
          <creation_ts>2008-09-18 18:09:42 +0000</creation_ts>
          <short_desc>[FT] Constraints on score variables?</short_desc>
          <delta_ts>2008-10-30 18:51:04 +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>Full Text 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Mary Holstege">holstege</reporter>
          <assigned_to name="Jim Melton">jim.melton</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>21938</commentid>
    <comment_count>0</comment_count>
    <who name="Mary Holstege">holstege</who>
    <bug_when>2008-09-18 18:09:42 +0000</bug_when>
    <thetext>Section 2.3 Score Variables does not explicitly state what the scope of score variables is, nor give any rules about whether, for example, a positional variable and a score variable in the same for clause can have the same name.

The scope could perhaps be inferred from what XQuery section 3.8.1 says:
&lt;quote&gt;
The scope of a variable bound in a for or let clause comprises all subexpressions of the containing FLWOR expression that appear after the variable binding. The scope does not include the expression to which the variable is bound...

The for and let clauses of a given FLWOR expression may bind the same variable name more than once. In this case, each new binding occludes the previous one, which becomes inaccessible in the remainder of the FLWOR expression.
&lt;/quote&gt;

But we might want to reference this or adopt it to be clear.

I propose we adopt wording similar to that in XQuery section 3.8.1, e.g.

The expanded QName of a score variable must be distinct from both the expanded QName of the variable with which it is associated and any positional variable with which it is associated [err:XQST0089].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22300</commentid>
    <comment_count>1</comment_count>
    <who name="Mary Holstege">holstege</who>
    <bug_when>2008-10-30 18:50:53 +0000</bug_when>
    <thetext>The WG discussed this issue at its meeting on 2008-10-30 and agreed.
The following text was added to the text in section 2.3 (Score Variables):

The scope of a score variable bound in a for or let clause comprises all subexpressions of the containing FLWOR expression that appear after the variable binding. The scope does not include the expression to which the variable is bound. The for and let clauses of a given FLWOR expression may bind the same score variable name more than once. In this case, each new binding occludes the previous one, which becomes inaccessible in the remainder of the FLWOR expression.

The expanded QName of a score variable bound in a for clause must be distinct from both the expanded QName of the variable with which it is associated and the expanded QName of any positional variable with which it is associated [err:XQST0089]XQ.

Since you were present when the decision was made, we assume you agree and will mark the bug as closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>