<?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>5652</bug_id>
          
          <creation_ts>2008-04-22 13:29:11 +0000</creation_ts>
          <short_desc>Constuctors for union types</short_desc>
          <delta_ts>2008-04-22 14:07:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nick Jones">nick</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>19903</commentid>
    <comment_count>0</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2008-04-22 13:29:11 +0000</bug_when>
    <thetext>Imagine a schema defining my:sizeType

  &lt;xs:simpleType name=&quot;sizeType&quot;&gt;
    &lt;xs:union memberType=&quot;xs:integer xs:string&quot;/&gt;
  &lt;/xs:simpleType&gt;

The various specifications seem to suggest such a constructor exists (5.4) but do not appear to be clear as to what the behaviour of a constructor for such a union type should be.

So for example, should

my:sizeType(&quot;123&quot;) instance of xs:integer

return true, false, or throw an exception (for the constructor being invalid - if so which?).

Our thoughts are that the behaviour should be the same as during schema validation (so should map to an xs:integer and hence return true), but are unable to find anything definite in the specification to confirm this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19904</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-04-22 13:41:19 +0000</bug_when>
    <thetext>(Personal response)

Section 5.4 starts:

&quot;For every atomic type in the static context that is derived from a primitive type, there is a constructor function...&quot;

A union type is not an atomic type; I think it is quite clear that constructor functions are not defined for list and union types. It would be nice if they were, but currently they are not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19905</commentid>
    <comment_count>2</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2008-04-22 14:07:27 +0000</bug_when>
    <thetext>OK. That makes sense.

(We were getting confused as were reading &quot;For every atomic type&quot; as &quot;Any type which is a subtype of xs:anyAtomicType&quot;, which the union types are, but clearly isn&apos;t what is actually being described in 5.4)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>