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 17226 - [QT3TS] CastAs-UnionType-16
Summary: [QT3TS] CastAs-UnionType-16
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
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: 2012-05-28 16:01 UTC by Tim Mills
Modified: 2015-07-09 15:40 UTC (History)
2 users (show)

See Also:


Attachments

Description Tim Mills 2012-05-28 16:01:43 UTC
This test uses the constructor function s:lowercaseName, but s:lowercaseName is not a generalized atomic type because it has a pattern facet.  Therefore the no such constructor function is available.
Comment 1 Tim Mills 2012-05-28 16:15:13 UTC
s:lowercaseName is also used in

CastAs-UnionType-22
CastAs-UnionType-23
CastAs-UnionType-24
Comment 2 Michael Kay 2012-05-28 16:54:38 UTC
We now allow casting from string and untypedAtomic to any simple type other than the abstract types xs:anySimpleType and xs:NOTATION, with semantics equivalent to validation.
Comment 3 Tim Mills 2012-05-29 10:30:34 UTC
Thanks.
Comment 4 Josh Spiegel 2015-07-09 11:47:38 UTC
Can you clarify why a constructor function is expected for s:lowercaseName?

http://www.w3.org/TR/xquery-30/#id-constructor-functions

"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."

[Definition: A generalized atomic type is a type which is either (a) an atomic type or (b) a pure union type ].

[Definition: A pure union type is an XML Schema union type that satisfies the following constraints: (1) {variety} is union, (2) the {facets} property is empty, .....

s:lowercaseName has facets so it isn't a pure union type or a generalized atomic type.  The test description is "Constructor function for union type with facets".

Am I missing something?
Comment 5 Josh Spiegel 2015-07-09 12:08:16 UTC
I may have found it in 4.11 Schema Import:

"For each named user-defined simple type in the schema, schema import also adds a corresponding constructor function. "
Comment 6 Michael Kay 2015-07-09 13:25:05 UTC
Also F+O 18.5: For every user-defined simple type in the static context (See Section 2.1.1 Static Context XP31), there is a constructor function whose name is the same as the name of the type and whose effect is to create a value of that type from the supplied argument. 

But XPath 3.14.4 has it wrong: "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."
Comment 7 Josh Spiegel 2015-07-09 15:40:29 UTC
Thanks.  I just noticed that bug 28915 already addresses this.  I am changing this test suite bug back to INVALID since the issue is in the specification.