<?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>26844</bug_id>
          
          <creation_ts>2014-09-18 10:57:33 +0000</creation_ts>
          <short_desc>[XP31] Wrong error code</short_desc>
          <delta_ts>2015-07-07 22:55:19 +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>XPath 3.1</component>
          <version>Working drafts</version>
          <rep_platform>SGI</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xpath-31.html#id-atomization</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="Tim Mills">tim</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>andrew_coleman</cc>
    
    <cc>josh.spiegel</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>111738</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2014-09-18 10:57:33 +0000</bug_when>
    <thetext>Under atomization, XPath 3.1 says:

&quot;If the item is a functionDM30 [err:FOTY0012] is raised.&quot;

but F&amp;O says:

&quot;A type error is raised [err:FOTY0013] if an item in the sequence $arg is a function item.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112030</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2014-09-23 17:17:29 +0000</bug_when>
    <thetext>f the item is a functionDM31 or map a type error [err:FOTY0012] is raised.

If the item is an array $a, atomization is defined as $a?* ! fn:data(.), which is equivalent to atomizing the members of the array.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112031</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-09-23 17:17:59 +0000</bug_when>
    <thetext>I will change the language spec to use the F&amp;O error code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112032</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2014-09-23 17:18:21 +0000</bug_when>
    <thetext>I propose swapping the order to:

* If the item is an array $a, atomization is defined as $a?* ! fn:data(.), which is equivalent to atomizing the members of the array.

* f the item is a functionDM31 or map a type error [err:FOTY0012] is raised.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114151</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-28 18:05:04 +0000</bug_when>
    <thetext>(In reply to Tim Mills from comment #3)
&gt; I propose swapping the order to:
&gt; 
&gt; * If the item is an array $a, atomization is defined as $a?* ! fn:data(.),
&gt; which is equivalent to atomizing the members of the array.
&gt; 
&gt; * If the item is a functionDM31 or map a type error [err:FOTY0012] is raised.

We assume the issue is that an array is a function.  But these bullet points do not imply sequence, so a better fix is:

* If the item is a functionDM31 (other than an array) or map a type error [err:FOTY0012] is raised.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114152</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-28 18:06:55 +0000</bug_when>
    <thetext>The Working Group agreed to resolve this as proposed in comment #4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121771</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-07-06 08:34:07 +0000</bug_when>
    <thetext>The change has not been applied in the current draft of the spec. The text still reads:

[3] If the item is a function1 or map...
[4] If the item is an array...

where the conditional in bullet 4 overrides that in bullet 3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121864</commentid>
    <comment_count>7</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-07-07 22:55:19 +0000</bug_when>
    <thetext>Applied comment 4.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>