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 27382 - [xp3.1] Arrays - errors
Summary: [xp3.1] Arrays - errors
Status: CLOSED 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: 2014-11-20 16:13 UTC by Michael Kay
Modified: 2015-07-06 08:40 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2014-11-20 16:13:58 UTC
XPath 3.1 section 3.11.3.1 has 

If the context item is not a map or an array, an error is raised [err:XPTY0tbd].

We need to allocate an error code. (Why not XPTY0004 as usual?)

XPath maps A?n and ?n onto A(n) -- but not onto array:get(A, n).

If n is out of range, all these XPath constructs throw XPDY0138. But array:get(A, n), and other functions like array:remove(), throw FOAY0001.

Do we really want to have two different error codes for "array index out of range"? It makes it harder for users to remember which error to catch, and it makes it harder for implementors, because it isn't possible simply to compile A?n, A(n), and array:get(A, n) to identical code.
Comment 1 Andrew Coleman 2014-11-28 14:02:46 UTC
The working group decided on the following resolution at the 2014-11-25 teleconference:

RESOLVED: to address bug 27382 by unifying the error codes in
question, preferably by using FOAY0001. (Rationale: it's more
memorable, and thus better for an error people are likely to want to
catch frequently.)
Comment 2 Jonathan Robie 2014-12-09 00:00:58 UTC
Fixed in internal draft.
Comment 3 Michael Kay 2015-07-06 08:40:41 UTC
Confirmed that the fix has been applied.