This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
The text seems perfectly clear to me.
(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.
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>