W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2016

[Bug 29487] New: [XPath31]https://www.w3.org/TR/xpath-31/#id-unary-lookup wrongly compares array?* to array:flatten

From: <bugzilla@jessica.w3.org>
Date: Fri, 19 Feb 2016 15:48:44 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29487-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29487

            Bug ID: 29487
           Summary: [XPath31]https://www.w3.org/TR/xpath-31/#id-unary-look
                    up wrongly compares array?* to array:flatten
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: martin.honnen@gmx.de
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

The section https://www.w3.org/TR/xpath-31/#id-unary-lookup defines the '?'
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 ("*"), 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], ['a', 'b']]) gives a sequence of atomic items (1, 2,
"a", "b") while [[1, 2], ['a', 'b']]?* gives a sequence ([1, 2], ["a", "b"])
 of two arrays.

So I would like clarification on that note saying "This is also equivalent to
Section 17.3.17 array:flatten FO31", in my view it is wrong.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 19 February 2016 15:48:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:59 UTC