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 5706 - [F&O] Overflow errors in casting to gYear, gYearMonth.
Summary: [F&O] Overflow errors in casting to gYear, gYearMonth.
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-21 15:41 UTC by Oliver Hallam
Modified: 2008-07-09 14:20 UTC (History)
0 users

See Also:


Attachments

Description Oliver Hallam 2008-05-21 15:41:03 UTC
The range of gYear and gYearMonth are implementation defined (XQuery 5.3.4).

Section 17.1.1 of functions and operators says (re. casting from strings):

In casting to a date or time value, if the value is too large or too small to be represented by the implementation, error [err:FODT0001] is raised.

In casting to a duration value, if the value is too large or too small to be represented by the implementation, error [err:FODT0002] is raised.

For xs:anyURI, the extent to which an implementation validates the lexical form of xs:anyURI is ·implementation dependent·.

If the cast fails for any other reason, error [err:FORG0001] is raised.

If the phrase "date or time value" was intended to include gYear and gYearMonth, then this could have been phrased more clearly.

Otherwise it does not seem desirable to raise a FORG0001 error when a value is too large for gYear or gYearMonth (especially since this case is covered for all other types with implementation defined limits).  Ideally this should be either covered by FODT0001, or by a new error code (e.g. FODT0004).
Comment 1 Michael Kay 2008-05-21 16:23:21 UTC
I propose changing the sentence from 

In casting to a date or time value, if the value is too large or too small to
be represented by the implementation, error [err:FODT0001] is raised.

to

In casting to xs:date, xs:dateTime, xs:gYear, or xs:gYearMonth (or types derived from these), if the value is too large or too small to be represented by the implementation, error [err:FODT0001] is raised.
Comment 2 Michael Kay 2008-07-08 22:24:05 UTC
On 27 May 2008 (recorded in the minutes but sadly not here), the joint WGs agreed to accept the change proposed in comment #1.

Oliver, if you accept this resolution, I would be grateful if you would mark the bug as closed.

This will be the subject of erratum E28
Comment 3 Oliver Hallam 2008-07-09 14:20:19 UTC
I agree with this resolution.  Thanks.