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 4026 - validateexpr-24
Summary: validateexpr-24
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-29 16:15 UTC by Tim Mills
Modified: 2006-11-30 06:58 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2006-11-29 16:15:50 UTC
This test makes tests validation using the schema:

  <xs:simpleType name="unionType">
    <xs:union memberTypes="xs:integer xs:float"/>
  </xs:simpleType>

  <xs:simpleType name="listType">
    <xs:list itemType="lu:unionType"/>
  </xs:simpleType>

  <xs:element name="e" type="lu:listType"/>

The test validates:

<lu:e>1 1.0e0</lu:e>

and checks that the first item is a instance of xs:integer, and the second is an instance of xs:float.

Howevre, since the lexical space of xs:float is a superset of xs:integer, is a validator not permitted to determine that both of these are instances of xs:float?

I can't find anything in the specs (XQuery or XML Schema) which specifies the order in which a lexical representation is tested against the member types of a union.
Comment 1 Michael Kay 2006-11-29 17:08:33 UTC
XML Schema Part 2 section 2.5.1.3

The order in which the ·memberTypes· are specified in the definition (that is, the order of the <simpleType> children of the <union> element, or the order of the QNames in the memberTypes attribute) is significant. During validation, an element or attribute's value is validated against the ·memberTypes· in the order in which they appear in the definition until a match is found. The evaluation order can be overridden with the use of xsi:type.
Comment 2 Tim Mills 2006-11-30 06:57:28 UTC
Thanks.  I spent all day looking in Part 1.