<?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>10882</bug_id>
          
          <creation_ts>2010-09-30 18:02:46 +0000</creation_ts>
          <short_desc>[XQ31ReqUC] Why do external types introduced by external functions have to be subtypes of xs:anyAtomicType?</short_desc>
          <delta_ts>2014-05-20 16:48:49 +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>Requirements for Future Versions</component>
          <version>Member-only Editors Drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Oliver Hallam">oliver</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>jonathan.robie</cc>
    
    <cc>mike</cc>
          
          <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>40231</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Hallam">oliver</who>
    <bug_when>2010-09-30 18:02:46 +0000</bug_when>
    <thetext>Section 4.18 states:

An XQuery implementation may augment the type system of [XQuery and XPath Data Model (XDM) 1.1] with additional types that are designed to facilitate exchange of data with host programming languages, or it may provide mechanisms for the user to define such types. For example, a type might be provided that encapsulates an object returned by an external function, such as an SQL database connection. These additional types, if defined, are considered to be derived by restriction from xs:anyAtomicType.

This should say the implementation can augment XDM with additional item types, as I assume sequences of these types are also allowed.

I would also like to know why these types must be subtypes of xs:anyAtomicType, and not just subtypes of item().

There are many expressions in XQuery that take arguments of type xs:anyAtomicType and behaviours would have to be defined for these expressions.   I guess most of the time the behaviour would be to raise an error.  If they don&apos;t behave like atomic values, then maybe they shouldn&apos;t be atomic values.

For similar reasons that function items are not atomic values, atomic values are a often a poor fit for new types introduced.

I would suggest changing the text to the following:

An XQuery implementation may augment the type system of [XQuery and XPath Data Model (XDM) 1.1] with additional item types that are designed to facilitate exchange of data with host programming languages, or it may provide mechanisms for the user to define such types. For example, a type might be provided that encapsulates an object returned by an external function, such as an SQL database connection. These additional types, if defined, are considered to be derived by restriction from xs:anyAtomicType or subtypes of item() (but not node(), xs:anyAtomicType or function(*)).

I hate to say it but should these types not also be mentioned in the data model?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40307</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-09-30 21:20:28 +0000</bug_when>
    <thetext>I agree, we should allow implementation-defined subtypes of item(). Saxon&apos;s extension types have traditionally been subtypes of anyAtomic, and there are definitely cases where this doesn&apos;t make much sense.

Such a change might have more consequences than we can immediately foresee, but having opened the door with function items to a third kind of item, I&apos;m more confident that the language doesn&apos;t fundamentally break if you open things up at this point.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42075</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2010-11-03 19:06:36 +0000</bug_when>
    <thetext>I&apos;m concerned about introducing new bugs. Statements we make about how types operate might be false if we change the organization of the type hierarchy. And I think this is just too late in the process for XQuery to change the type hierarchy.

I can&apos;t see how we would get any interop around such types, or how it would affect current implementations if we made this change.

I suggest we consider this in v.Next.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42569</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2010-11-16 18:08:14 +0000</bug_when>
    <thetext>We did not have consensus to do this in XQuery 3.0 - there was consensus we would like this for future versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84213</commentid>
    <comment_count>4</comment_count>
      <attachid>1335</attachid>
    <who name="tia">tiarhoton</who>
    <bug_when>2013-03-11 07:26:37 +0000</bug_when>
    <thetext>Created attachment 1335
sample file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84253</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-03-11 17:01:01 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Created attachment 1335 [details]
&gt; sample file

A PowerPoint presentation on Second Quarter Widget Sales? Are attachments like this scanned for viruses in Bugzilla?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84257</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-03-11 17:29:53 +0000</bug_when>
    <thetext>You opened it? You&apos;re a braver man than me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84293</commentid>
    <comment_count>7</comment_count>
    <who name="Carine Bournez">carine</who>
    <bug_when>2013-03-12 15:39:45 +0000</bug_when>
    <thetext>The content of attachment 1335 has been deleted by
    Carine Bournez &lt;carine@w3.org&gt;
without providing any reason.

The token used to delete this attachment was generated at 2013-03-12 15:39:40 UTC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106467</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-05-20 16:48:49 +0000</bug_when>
    <thetext>Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1335</attachid>
            <date>2013-03-11 07:26:37 +0000</date>
            <delta_ts>2013-03-11 07:26:37 +0000</delta_ts>
            <desc>sample file</desc>
            <filename>ACME Presentation.pptx</filename>
            <type>text/plain</type>
            <size>0</size>
            <attacher name="tia">tiarhoton</attacher>
            
              <data encoding="base64"></data>

          </attachment>
      

    </bug>

</bugzilla>