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 28915 - XQuery inconsistent about constructor functions for list types
Summary: XQuery inconsistent about constructor functions for list types
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.1 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-06 17:40 UTC by Priscilla Walmsley
Modified: 2015-07-10 19:15 UTC (History)
1 user (show)

See Also:


Attachments

Description Priscilla Walmsley 2015-07-06 17:40:13 UTC
F&O says "For every user-defined simple type in the static context (See Section 2.1.1 Static Context XP31), there is a constructor function" and goes on to explain that this includes list and union types. 

But the XQuery spec, in multiple places, seems to deliberately exclude list types when talking about constructor functions.  For example:

Section 3.1.1 "Values of other atomic types can be constructed by calling the constructor function for the given type"  (Note "atomic" instead of "simple")

Section 3.1.1 "Constructor functions are available for all Generalized atomic types,"  (where the definition of generalized atomic types specifically excludes list types)

Section 3.17.5 "For every generalized atomic type in the in-scope schema types (except xs:NOTATION and xs:anyAtomicType, which are not instantiable), a constructor function is implicitly defined."  (Again refers to generalized atomic types)

In the glossary, "The constructor function for a given type is used to convert instances of other atomic types into the given type." (Use of "atomic")


However, elsewhere, e.g. Section 4.11, it says there is a constructor function for every named user-defined simple type, so that's consistent with F&O.
Comment 1 Josh Spiegel 2015-07-09 15:34:09 UTC
I agree.  I don't think XQuery/XPath should be using "generalized atomic type" to define constructor functions.  (see bug 17226)

There are two more references in appendix C:
"functions in fn namespace, and constructors for built-in generalized atomic types"
Comment 2 Josh Spiegel 2015-07-09 21:30:17 UTC
This part in XQ31 3.17.5 Constructor Functions will need to be changed as well:

<quote>
  The signature of the constructor function for type T is as follows:
  
    T($arg as xs:anyAtomicType?) as T?
</quote>

This is not true if T is a list type.  

  http://www.w3.org/TR/xpath-functions-31/#constructor-functions-for-xsd-list-types
  http://www.w3.org/TR/xpath-functions-31/#constructor-functions-for-user-defined-types
Comment 3 Jonathan Robie 2015-07-10 19:15:34 UTC
Fixed in the current html build.