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 2724 - Context position : some inconsistencies about what it is supposed to be.
Summary: Context position : some inconsistencies about what it is supposed to be.
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-18 08:15 UTC by Pierrick Brihaye
Modified: 2006-02-23 00:05 UTC (History)
0 users

See Also:


Attachments

Description Pierrick Brihaye 2006-01-18 08:15:23 UTC
The specs give very strict indications about how context positions should be
assigned a value :

Its value is always an integer greater than zero
The position of the first item in a sequence is always 1 (one)
The context position is always less than or equal to the context size
Context positions are assigned to items based on their ordinal position in the
result sequence. The first context position is 1.
The context position is the position of the context item within the sequence of
items currently being processed.

Sometimes however, other solutions are (fortunately) possible : 
 
During evaluation of a function body, the focus (context item, context position,
and context size) is undefined
[C.2 Dynamic Context Components]
Default initial value : none
Consistency rules : If context item is defined, context position must be >0 and
<= context size; else context position is undefined.

May the specs be more consistent and precise about defined/undefined focus ?
Comment 1 Jonathan Robie 2006-01-31 22:33:14 UTC
Context position is sometimes undefined. In contexts where it is defined, our
specs say how it is defined. In contexts where it can be undefined, we state
that fact.

I do not understand what is inconsistent or imprecise about our specs with
respect to context position - can you please clarify?
Comment 2 Pierrick Brihaye 2006-02-01 09:55:18 UTC
I just request some precisions that would make paragraphs more "autonomous".

For example :
[Definition: The context position is the position of the context item within the
sequence of items currently being processed.]
I would preprend something like : "When the focus is defined..."

The like for :
The context position is the position of the context item within the sequence of
items currently being processed.

I could cope with the expression of the C2 table ("If context item is defined")
 but the notion of "focus" looks to me more generic.



 
Comment 3 Don Chamberlin 2006-02-23 00:05:14 UTC
Pierrick,
Thanks for your comment. The Query and XSLT working groups considered your 
comment on 02 Feb 2006 and agreed to add the phrase "When the focus is defined" 
to the definition of context position, as you suggested. The change will be 
included in the next published version of the XPath and XQuery specifications. 
Since we consider this to be an editorial rather than a substantive change, I 
have marked this issue as closed.
Regards,
Don Chamberlin, for the Query and XSLT working groups