Hi Martin,
I found even more weird situation parse-json('{"1:aa": 1, "2:bb": 2}') returns {"2:bb":2.0e0,"1:aa":1.0e0}
Seems like order is inversed But, parse-json('{"aa": 1, "b": 2, "ab": 3}') returns {"aa":1.0e0,"ab":3.0e0,"b":2.0e0}
and, finally parse-json('{"aa": 1, "b": 2, "ab": 3, "1:aa": 1, "2:bb": 2}') returns {"aa":1.0e0,"ab":3.0e0,"b":2.0e0,"2:bb":2.0e0,"1:aa":1.0e0}
🤯
It seems like a bug to me ;)
If we are talking about the JSON standard, not xQuery, devs will expect the function which behaves in the same way as it does in many other languages.
On Mon, Dec 16, 2024 at 3:31 PM Martin Honnen martin.honnen@gmx.de wrote:
Am 16.12.2024 um 14:15 schrieb Martin Honnen:
There is a big debate in the working group developing XQuery, XPath and XSLT 4 on whether to introduce a new map type that preserves key insertion/creation order