<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3229</bug_id>
          
          <creation_ts>2006-05-09 10:00:22 +0000</creation_ts>
          <short_desc>Lexical mapping for a union type</short_desc>
          <delta_ts>2006-12-08 18:02:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Datatypes: XSD Part 2</component>
          <version>1.1 only</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>3025</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>important, work, mappings cluster</status_whiteboard>
          <keywords>editorial</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>9641</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-05-09 10:00:22 +0000</bug_when>
    <thetext>QT approved comment:

In 2.6.1, I don&apos;t think it&apos;s correct to say that the lexical mapping for
a union is the union of the lexical mappings of its member types. Rather,
the lexical mappings are combined using an algorithm that treats the member
types as ordered so as to disambiguate the mapping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11545</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-09-09 01:55:02 +0000</bug_when>
    <thetext>Thank you for the comment.  I believe it&apos;s a question of choice.  At least,
I believe that the desired behaviors can be modeled in at least two
ways.

One is the way you describe:  mappings of union types are created with 
a sequence of set overlays, xsi:type modifies the mapping, or
perhaps specifies a different one entirely, but is restricted to 
the mapping of one of the member types, and so on with
whatever changes that way of describing things would entail. 

The other is the way we chose (and have endeavored, with imperfect
success, to make clearer in the spec):  the mapping of a union type
is the union of the mappings of the members.  When for practical
reasons one wants to have a unique value rather than a set of
values (as, for example, when validating), one can apply some
appropriate set of rules to choose the appropriate value.  In the
case of schema-validity assessment, the rule is to consult the 
order of the types in the union, unless xsi:type tells you to
choose a different value.  In the case of anySimpleType, which
is the *unordered* union of all simple types, one may wish to
use rules like the type coercion rules of XSLT 2.0 and XQuery.

As that last example hints, the XML Schema WG believes that the 
union-as-union approach gives a better story for explaining
why the QT rules for anySimpleType (under the relabeling
&apos;untypedAtomic&apos;) are actually OK and not something to object
to.

All that said, the comment suggests that some, at least, of the
exposition could usefully be revised.  I&apos;m marking the issue
as editorial for that reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12817</commentid>
    <comment_count>2</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-11-04 02:15:40 +0000</bug_when>
    <thetext>Bug 3025 subsumes this bug, so I&apos;m closing this one as a duplicate of bug 3025.

*** This bug has been marked as a duplicate of bug 3025 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>