[Bug 5706] [F&O] Overflow errors in casting to gYear, gYearMonth.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5706

           Summary: [F&O] Overflow errors in casting to gYear, gYearMonth.
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


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).

Received on Wednesday, 21 May 2008 15:41:46 UTC