This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29607 - [FO31] array join
Summary: [FO31] array join
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2016-05-03 10:19 UTC by Tim Mills
Modified: 2016-07-21 15:07 UTC (History)
1 user (show)

See Also:


Description Tim Mills 2016-05-03 10:19:52 UTC
Array join is defined as:

    declare function array:join($arrays as array(*)*) as array(*) {
              if (fn:count($arrays) lt 2)
              then $arrays
              else op:array-concat(fn:head($arrays), array:join(fn:tail($arrays)))

if $arrays has count zero (i.e. $arrays is the empty sequence), then this definition says we return the empty sequence which is not permitted by the static return type, however the example

The expression array:join(()) returns [ ].

shows the intention is that the empty array is returned.
Comment 1 Michael Kay 2016-05-10 15:24:12 UTC
Agreed that this should be fixed: array:join(()) should return [].
Comment 2 Andrew Coleman 2016-05-12 19:55:53 UTC
ACTION A-643-02: MikeK to fix definition of array:join so that joining 
zero arrays returns an empty array
Comment 3 Michael Kay 2016-07-21 15:07:49 UTC
Confirmed that the change was applied.