[Bug 27463] [XQ31] Arrays within element constructors

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27463

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
The XQuery 3.1 specification states that when an array appears within the
content of an element constructor, it is atomized. For example

<a>{[<b/>, <c/>, <d/>]}</a>

produces the output

<a/>

This seems to conflict with the decision we made for serialization, where we
said that if nodes appear within an array during JSON serialization, the nodes
are expanded using XML serialization. It also seems counter-intuitive since
element constructors do not normally atomize any nodes appearing within their
content; it seems odd to treat enclosed nodes differently just because they
appear within an array.

I think it would cause fewer surprises if an array appearing in such a context
were recursively flattened (that is, replacing $A by $A?*) rather than being
atomized.

Incidentally, there is also a problem with the way the rules are given in
section 3.9.1.3: rule 1.e.ii should appear before 1.e.i, because otherwise,
arrays are rejected by virtue of the fact that they are functions.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 28 November 2014 12:00:56 UTC