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 26926 - [F+O] 3.1 Components of a Duration
Summary: [F+O] 3.1 Components of a Duration
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 minor
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: 2014-09-29 12:01 UTC by Michael Kay
Modified: 2014-11-17 09:59 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2014-09-29 12:01:07 UTC
Now that the dayTimeDuration and yearMonthDuration types are defined in XSD, we need to change the text in the specification of functions such as days-from-duration() to cut out the reference to the F+O specifications of these types (which at the time of writing is currently a broken link).

The specification says: 

The result is obtained by casting $arg to an xs:dayTimeDuration (see 19.1.3 Casting to duration types) and then computing the days component as described in 8.1.2.3 Canonical representation.

But the specification of casting says: 

If ST is xs:duration, or a type derived from duration, but not xs:yearMonthDuration or a type derived from xs:yearMonthDuration, and TT is xs:dayTimeDuration, then TV is derived from SV by removing the year and month components from SV.

The casting section talks without further explanation about "removing components" of the value, yet it's cited from a function spec that feels a need for a precise definition of what these components are.

The simplest solution seems to be to replace the text

Otherwise, the function returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 19.1.3 Casting to duration types) and then computing the days component as described in 8.1.2.3 Canonical representation.

with

Otherwise, the function returns an xs:integer representing the days component in the value of $arg. Given that the value space of xs:duration consists of ($months, $seconds) tuples, the result is ($seoonds idiv 86400). 

and similarly for the other X-from-duration() functions.
Comment 1 Michael Kay 2014-09-29 14:02:22 UTC
The change has been applied.