Extracted from #576:
All serialization methods except for json allow sequences to be output on top level. We should also allow this for JSON data. This way, constructs like…
declare option output:item-separator '
';
declare option output:method 'text';
for $json in ({ 1: 2 }, { 3: 4 })
return serialize($json, { 'method': 'json' })
…can be simplified to:
declare option output:method 'json';
{ 1: 2 },
{ 3: 4 }
We should still not allow sequences within JSON structures. It would be inconsistent to have different output rules depending on the number of items in a sequence ((1) and [1] would not be serialized identically).
Extracted from #576:
All serialization methods except for
jsonallow sequences to be output on top level. We should also allow this for JSON data. This way, constructs like……can be simplified to:
We should still not allow sequences within JSON structures. It would be inconsistent to have different output rules depending on the number of items in a sequence (
(1)and[1]would not be serialized identically).