<?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>29487</bug_id>
          
          <creation_ts>2016-02-19 15:48:44 +0000</creation_ts>
          <short_desc>[XPath31] Section 3.11.3.1 Unary Lookup wrongly compares array?* to array:flatten</short_desc>
          <delta_ts>2016-03-11 13:17:53 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Martin Honnen">martin.honnen</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>andrew_coleman</cc>
    
    <cc>john</cc>
    
    <cc>josh.spiegel</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>125165</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Honnen">martin.honnen</who>
    <bug_when>2016-02-19 15:48:44 +0000</bug_when>
    <thetext>The section https://www.w3.org/TR/xpath-31/#id-unary-lookup defines the &apos;?&apos; unary lookup operator on maps and arrays, for arrays at the item (4.) it says about doing 

array?*

----- quote ----
If the KeySpecifier is a wildcard (&quot;*&quot;), the UnaryLookup operator is equivalent to the following expression:

for $k in 1 to array:size(.)
return .($k)

Note:

This is also equivalent to Section 17.3.17 array:flatten FO31.
---- end quote ----

The comparison to array:flatten seems wrong in my understanding as array:flatten is recursive while the array?* definition is not recursive.

So array:flatten([[1, 2], [&apos;a&apos;, &apos;b&apos;]]) gives a sequence of atomic items (1, 2, &quot;a&quot;, &quot;b&quot;) while [[1, 2], [&apos;a&apos;, &apos;b&apos;]]?* gives a sequence ([1, 2], [&quot;a&quot;, &quot;b&quot;])
 of two arrays.

So I would like clarification on that note saying &quot;This is also equivalent to Section 17.3.17 array:flatten FO31&quot;, in my view it is wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125166</commentid>
    <comment_count>1</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-02-19 16:01:58 +0000</bug_when>
    <thetext>I agree, good catch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125253</commentid>
    <comment_count>2</comment_count>
    <who name="johnlumley">john</who>
    <bug_when>2016-02-25 09:32:02 +0000</bug_when>
    <thetext>It might also be worthwhile adding for clarification an example where internal sequences are also &apos;flattened&apos;, e.g.

[1, 2, (5, 6), [7, 8]]?* evaluates to (1, 2, 5, 6, [7, 8])</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125440</commentid>
    <comment_count>3</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-03-11 13:17:53 +0000</bug_when>
    <thetext>At the meeting on 2016-03-08, the WG agreed to fix this editorially</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>