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 29863 - [FO31] Is there a constructor function for xs:numeric?
Summary: [FO31] Is there a constructor function for xs:numeric?
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2016-09-22 19:41 UTC by Michael Kay
Modified: 2016-12-16 19:55 UTC (History)
0 users

See Also:


Description Michael Kay 2016-09-22 19:41:11 UTC
Is there a constructor function for xs:numeric?

The intro to section 18 says:

Constructor functions are defined for all user-defined named simple types, and for most built-in atomic, list, and union types. The only named simple types that have no constructor function are those that have no instances other than instances of their derived types: specifically, xs:anySimpleType, xs:anyAtomicType, and xs:NOTATION.

which would suggest yes (unless one argues that xs:numeric is neither a user-defined type nor a built-in type).

But no constructor function is listed in 18.4; constructors for all other types in the xs namespace are explicitly enumerated.

Although there's little practical use for the function, consistency really demands that it exists, and we should therefore list it in 18.4.
Comment 1 Michael Kay 2016-09-22 19:46:00 UTC
We have a couple of test cases that assume a constructor function for xs:numeric exists, and no-one has challenged them; so I think the answer is that the function does exist and we should list it in 18.4.
Comment 2 Michael Kay 2016-09-27 21:33:41 UTC
The WG agreed that a constructor function exists and should be documented.

The WG also asked the editor to add a note explaining the somewhat counter-intuitive behaviour whereby the result of xs:numeric() applied to a string is always an xs:double irrespective of the lexical form of the argument.

The changes have been applied.