[Bug 4856] [F&O] arithmetic on durations

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

           Summary: [F&O] arithmetic on durations
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


Enhancement request.

There is no logical reason why arithmetic on durations should be confined to
the two subtypes xs:yearMonthDuration and xs:dayTimeDuration. All the various
permitted combinations:

(a) duration +|- duration
(b) duration *|div number
(c) date|time|dateTime +|- duration

are perfectly well-defined on all durations, and easily specified by
decomposing the duration into its two parts. For (a) the result should be the
least common supertype of the operand types; for (b) it should be the same as
the operand type.

Generalizing these operations to work on the primitive type will simplify the
specification, and is therefore likely to simplify implementations, as well as
providing useful functionality for users who have chosen to use the type
xs:duration (or their own subtypes thereof) in their schemas.

The main rationale, however, is the removal of an arbitrary restriction that
has no justification and delivers no benefits.

Received on Friday, 13 July 2007 14:53:17 UTC