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 3651 - Argument types of fn:dateTime
Summary: Argument types of fn:dateTime
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ashok Malhotra
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
: 1471 (view as bug list)
Depends on: 3717
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-04 14:44 UTC by Oliver Hallam
Modified: 2006-10-05 09:23 UTC (History)
1 user (show)

See Also:


Attachments

Description Oliver Hallam 2006-09-04 14:44:39 UTC
The definition of fn:dateTime (from section 5.2 of the spec) is:
fn:dateTime($arg1 as xs:date, $arg2 as xs:time) as xs:dateTime

In the examples (5.2.1) it is stated that:
fn:dateTime(xs:date("1999-12-31"), xs:time("12:00:00")) returns xs:dateTime("1999-12-31T12:00:00").

Section 5.1 states:
The form of the constructor function for a type prefix:TYPE is:
prefix:TYPE($arg as xs:anyAtomicType?) as prefix:TYPE?

Under the static typing feature the example should raise a type check error, as xs:date and xs:time have return types xs:date? and xs:time? respectively.

In order for the example to make sense (and to be consistent with other constructor functions) fn:dateTime should have the following signature:

fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime?

and it should return the empty sequence if either of the parameters are the empty sequence.
Comment 1 Frans Englich 2006-09-13 11:56:23 UTC
The resolution of 3717 could solve this report.
Comment 2 Andrew Eisenberg 2006-09-15 17:54:29 UTC
The XSL and XML Query WGs considered this issue at their Sept. 12 meeting.

The WGs agree with the changes that you have suggested:

- fn:dateTime should have the following signature:

  fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime?

- the function will return the empty sequence if either of the parameters are the empty sequence


Please close this bug report if you agree with our resolution.
Comment 3 Tim Mills 2006-09-22 10:18:37 UTC
Thanks.
Comment 4 Michael Kay 2006-10-05 09:23:36 UTC
*** Bug 1471 has been marked as a duplicate of this bug. ***