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 6094 - [FT] Constraints on score variables?
Summary: [FT] Constraints on score variables?
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-18 18:09 UTC by Mary Holstege
Modified: 2008-10-30 18:51 UTC (History)
0 users

See Also:


Attachments

Description Mary Holstege 2008-09-18 18:09:42 UTC
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:
<quote>
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.
</quote>

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].
Comment 1 Mary Holstege 2008-10-30 18:50:53 UTC
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.