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 1901 - Limitations on value ranges
Summary: Limitations on value ranges
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 2.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows 2000
: 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: 2005-08-29 15:46 UTC by Andreas Behm
Modified: 2005-09-29 12:55 UTC (History)
0 users

See Also:


Attachments

Description Andreas Behm 2005-08-29 15:46:28 UTC
While working on the test suite, we found that limitations on value ranges
are not specified clear enough in order to write tests that can run
on any implementation. 
While there are some rules on overflow of numeric operators, it is not clear
whether for example constructors with high precision as in
1.00000000000000000000000001 should succeed or not. Other areas are
limitations on string lengths or precision for numeric types.

Since atomic values are used in virtually any part of the test suite,
it will often happen that an implementation fails a tests solely because
of a different limitation on value ranges.

We would like to ask the working group to clarify the rules for value
limitations, and define the range for conforming implementations.

On behalf of the XQuery Test Task Force

Andreas
Comment 1 Paul Cotton 2005-08-29 16:37:43 UTC
Changing component to XPath since this impacts both XQuery and XPath.

/paulc
Comment 2 Don Chamberlin 2005-09-28 10:36:15 UTC
Andreas,
On Sept. 28, 2005, the Query Working Group considered your comment and resolved 
it as follows:

In XQuery Section 5.3 (Data Model Conformance), the following new rule will be 
added:

4. Ranges of data values: In XQuery, the following limits are
implementation-defined:

(a) For the xs:decimal type, the maximum number of decimal digits 
(totalDigits facet) (must be at least 18)

(b) For the types xs:date, xs:time, xs:dateTime, xs:gYear, 
xs:gYearMonth: the maximum value of the year component, and the
maximum number of fractional second digits (must be at least 3).

(c) For the xs:duration type: the maximum absolute values of the 
years, months, days, hours, minutes, and seconds components.

(d) For the xdt:yearMonthDuration type: the maximum absolute value,
expressed as an integer number of months.

(e) For the xdt:dayTimeDuration type: the maximum absolute value,
expressed as a decimal number of seconds.

(f) For the types xs:string, xs:hexBinary, xs:base64Binary, xs:QName, 
xs:anyURI, xs:NOTATION, and types derived from them: limitations (if any)
imposed by the implementation on lengths of values. 

Note that all of the above limitations
need not be fixed, but may depend on environmental factors such as 
system resources.

In the specific example cited in your comment, the decimal literal 
1.00000000000000000000000001, the XQuery document specifies that the
literal is converted to a decimal value by the rules for casting from
string to decimal, which in turn are defined by the rules for XML Schema
validation. XML Schema validation states that a value 
that is not exactly equal to any point in the target value space is mapped into 
the nearest point in the value space. Therefore the correct handling of the 
literal in your example is to map it into the decimal value 1.0.

I have marked your comment as "Resolved and fixed." If this resolution is 
acceptable to you, please change the status of this comment to "Closed".

Regards,
Don Chamberlin