eXist-db/exist — pull request #320 by wolfgangmm (2014-09-01 18:49:30+00:00)
Title: [feature] Align map support with XQuery 3.1 spec

# Changed constructor syntax:

`map { "key": 1 }` instead of map `{ "key" := 1 }`. For backwards compatibility, old syntax is still supported.

# Map lookup operators

* `$map?key` to lookup an entry by a simple string
* `$map?"key with space"`
* `$map?($key)` other expressions allowed in parenthesis
* `$map?key1?key2` lookup key2 in the inner map associated with key1
* `$map[?name = "John"]?phone` unary operator

# New function

`map:for-each-entry($input as map(*), $action as function($key as xs:anyAtomicType, $value as item()*)) as item()*`

For more examples, see the tests:

https://github.com/wolfgangmm/exist/blob/develop/test/src/xquery/maps/maps.xql