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 29614 - [FO31] fn:data
Summary: [FO31] fn:data
Status: CLOSED FIXED
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 editorial
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-06 10:39 UTC by Tim Mills
Modified: 2016-07-21 14:21 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2016-05-06 10:39:03 UTC
The description of fn:data on arrays in FO31

"If the item is an array, the result of applying fn:data to each member of the array, in order, is appended to the result sequence."

doesn't do as good a job of describing the case where the array is empty as in XQ31 which uses the text

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

Reading F&O only, I was expecting fn:data([]) to be similar to applying fn:data to a node which does not have a typed value.
Comment 1 Michael Kay 2016-05-06 16:20:09 UTC
The text seems perfectly clear to me.
Comment 2 Tim Mills 2016-05-09 09:54:16 UTC
(In reply to Michael Kay from comment #1)
> The text seems perfectly clear to me.

I'd like to see something along the lines of

  "If the array is empty, the result is the empty sequence".

added.
Comment 3 Michael Kay 2016-06-06 15:27:24 UTC
If we're going to say anything special about atomizing an empty array, then we also have to say something about atomizing an empty sequence, since currently both cases rely on the reader understanding that if you do something for each item/member, then if there are no items/members, you do nothing.

I have therefore added the notes:

<p>The result of atomizing an empty sequence is an empty sequence.</p>
         
<p>The result of atomizing an empty array is an empty sequence.</p>