Changes

Jump to navigation Jump to search
117 bytes removed ,  14:20, 11 October 2016
no edit summary
Some examples use the ''map'' {{Code|$week}} defined as:
<pre class="brush:xquery">
declare variable $week as map(*) := map { 0: "SonntagSun", 1: "MontagMon", 2: "DienstagTue", 3: "MittwochWed", 4: "DonnerstagThu", 5: "FreitagFri", 6: "SamstagSat"
};
</pre>
<pre class="brush:xquery">
map:merge((
map:entry("SuSun", "Sunday"), map:entry("MoMon", "Monday"), map:entry("TuTue", "Tuesday"), map:entry("WeWed", "Wednesday"), map:entry("ThThu", "Thursday"), map:entry("FrFri", "Friday"), map:entry("SaSat", "Saturday")
))
</pre>
| '''Examples'''
|
* {{Code|map:get($week, 4)}} returns {{Code|"DonnerstagThu"}}.
* {{Code|map:get($week, 9)}} returns {{Code|()}}. ''(When the key is not present, the function returns an empty sequence.).''
* {{Code|map:get(map:entry(7,())), 7)}} returns {{Code|()}}. ''(An empty sequence as the result can also signify that the key is present and the associated value is an empty sequence.).''
* The following function adds a seventh entry to an existing map:
<pre class="brush:xquery">
map:merge(($week, map { 7: "Unbekannt---" }))
</pre>
* In the following example, the values of all maps are combined, resulting in a map with a single key (<code>map { "key": (1, 2, 3) }</code>):
| '''Examples'''
|
* {{Code|map:remove($week, 4)}} creates <code>map { 0: "SonntagSun", 1: "MontagMon", 2: "DienstagTue", 3: "MittwochWed", 5: "FreitagFri", 6: "SamstagSat" }</code>.* {{Code|map:remove($week, 23)}} creates <code>map { 0: "SonntagSun", 1: "MontagMon", 2: "DienstagTue", 3: "MittwochWed", 4: "DonnerstagThu", 5: "FreitagFri", 6: "SamstagSat" }</code>.
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu