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 29227 - [XP31] Partially-defined focus
Summary: [XP31] Partially-defined focus
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.1 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 11:57 UTC by Michael Kay
Modified: 2015-12-02 16:34 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2015-10-22 11:57:19 UTC
XPath section 2.1.2 states:

If any component in the focus is defined, all components of the focus are defined. 

For streaming in XSLT 3.0 we are defining situations where this is no longer the case: for example during streamed merging, it's possible to have the context item and context position known, but the context size cannot be determined without lookahead, so any call on last() throws a dynamic error.

I would therefore suggest:

(a) the above sentence should be deleted, to be replaced perhaps with a note:

Note: Normally, if any component in the focus is defined, all components of the focus are defined. However, there may be situations where this is not the case, for example with streamed processing.

(b) in the error conditions for position() and last() the sentence "A dynamic error is raised [err:XPDY0002] if the context item is absent." should change to say "context position"/"context size" rather than "context item".

I don't actually envisage any situations where the context item is present and the context position is absent, nor situations where context position/size is present and context item is absent, but I see no reason to rule such things out for all possible invocations of XPath.
Comment 1 Jonathan Robie 2015-11-03 15:22:03 UTC
(In reply to Michael Kay from comment #0)

> (b) in the error conditions for position() and last() the sentence "A
> dynamic error is raised [err:XPDY0002] if the context item is absent."
> should change to say "context position"/"context size" rather than "context
> item".

I assume that:

1. This error description is only in F&O
2. We need to change it for last(), but not for position(), since we decided to make this change only for context size.
Comment 2 Andrew Coleman 2015-11-06 13:02:06 UTC
The WG agreed to adopt this change as proposed and affirmed the assumptions in comment 1.
Comment 3 Michael Kay 2015-12-02 16:34:18 UTC
The description of fn:last has been amended accordingly.